Desktop File Loader
by Lee Calcraft

When run, this application loads the GetKey module !LoadFile.RMGetKey, and changes the system variable Alias$@RunType_FFB. The result of this is that if the Ctrl key is held down while a Basic program is run, the program will be LOADED into Basic, rather than being run. Note that double clicking on an icon for a Basic program (or an application containing one) causes this to happen.

The program can then be run by typing RUN. When the program terminates, control will be returned to Basic, from where the program's variables can be examined. Note that this applies to programs which are run from within a !Run file for example, as well as programs which are run by double-clicking on their icon.

When a filetyped file is *Run, the system variable Alias$@RunType_xxx (where xxx is the filetype) is used to determine how to run the file. For Basic programs the default action is to execute 'Basic -quit "<filename>"', which enters Basic and RUNs the specified program, leaving Basic when the program terminates.

The application's !Run file changes this to:

GetKey|M If |<Get$Key><>1 Then Basic -quit |"%0" %*1 Else Basic -load |"%0" %*1

The GetKey command returns the state of the Ctrl key in the system variable Get$Key (1=pressed, 0=released). If the Ctrl key is pressed, then the program is loaded into Basic with 'Basic -load "<filename>"', rather than being run.

More information on using this program is given in this month's magazine (RISC User Volume 3 Issue 6 page 35).
