RMKill a module ONLY if it's loaded
SeñorNueces (1438) 162 posts |
Hi there, I would like to know how to kill a module (RMKill |
Martin Avison (27) 1494 posts |
Surely RMkill of a module that is not loaded will just fail anyway? |
Patrick M (2888) 115 posts |
I don’t know anything about RISC OS’s command line interpreter/shell, but is it possible to use negation? That is, the equivalent of “if NOT ( a module is not loaded ) then do something” |
Jeffrey Lee (213) 6048 posts |
Only when checking the values of variables/functions – and RMEnsure is a command, not a variable/function. There are two obvious options that come to mind: X RMKill FooModule The ‘X’ command ignores any error generated by the sub-command Set FooModule$Loaded 1 RMEnsure FooModule 0.00 Set FooModule$Loaded 0 If <FooModule$Loaded>=1 Then RMkill FooModule Unset FooModule$Loaded This is more long-winded, but will work on earlier OS versions (pre-3.5?) where ‘X’ isn’t available. And unlike the ‘X’ approach it will report an error if the module refuses to die. |
Rick Murray (539) 13840 posts |
If you can call a short BASIC program… It should be just this:
|
SeñorNueces (1438) 162 posts |
@All: Thanks for your fast responses, guys! This community is great indeed! |