XCLI  -  OS commands without errors

by Tony Howat

XCLI is a small relocatable module that allows you to make calls to the operating system without any errors being generated. It is particularly useful in Obey files since any error prevents the rest of the file being executed. For example, an Obey file might seek to access a file pinned to your pinboard but which is located on a remote system, or on a SyQuest or similar. If for any reason the file is not available when the Obey file is run, the resulting error will be ignored and will not prevent execution of the Obey file.

Running the item from the RISC User menu system opens a directory viewer containing the XCLI module and its source code, XCLIsource. The module is installed in the usualway by double-clicking on its icon. Once installed, it implements two commands. The first of these is the main command X. This is used with one parameter consisting of any other OS command. That command will then be run but any errors will be ignored. For example:
   X Run ADFS::0.$.!Boot
would attempt to run the file !Boot on drive 0,
but no error would be produced if the file could
not be found, or there was no disc in the drive
etc.

The second command is XCLI_Debug. This allows you to turn the effect of XCLI on or off. This is very useful for debugging - for example, sometimes you actually want to know if an error is occurring, and it would be inconvenient to have to amend the Obey file every time you want to change the status of the error-trapping. To turn XCLI's error suppression on, use:
  XCLI_Debug On
and to turn it off:
  XCLI_Debug Off

Further details are given in Just a Page in this month's RISC User magazine.

Copyright  RISC User 1995

