Post by email@example.com
As the title says, how can I test, from BASIC, the existence of a module ?
I'd like a real test for existence please, not a call and handling an
error returned if the module is not present. Thanks in advance.
Normally one would use the OS command RMEnsure in a Run file to check for
the presence of a module and this allows a command to be executed if it's
Normally this would be a command to RMLoad the module. But it could be
anything. It could be to raise an error, but it could be something else
You obviously have some reason for doing this from within a BASIC program,
whether multi or single-tasking.
I think if I had this problem I would call an Obeyfile from within the
BASIC and get it to set a system variable depending on the result.
When this OSCLI command returned to BASIC I would interrogate the system
variable using a routine such as this:
SYS"OS_ReadVarVal",sysvar$,block%,255,0,3 TO ,,val%
Note that this requires a variable block% to have been dimensioned to size
You then treat the returned string as a flag and do whatever you wish with
This avoids the error scenario as you wish.
John Williams, now back in the UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/