Just a Page Two short programs

by Lee Calcraft


Running this application opens up a directory viewer containing two short Basic programs from the Just A Page feature in RISC User magazine (6:10).

The programs are:
   idefsOFF
and
   WimpDebug
   
WimpDebug also contains an extra procedure not documented inside the magazine.   

SIMPLE VIRUS PROTECTION
idefsOFF is a very useful 3 line Basic program for owners of an IDEFS hard drive controller. Double-click on idefsOFF to set up F1 and F2 to respectively RMkill and RMreinit the IDEFS module. Whenever you want to examine a suspect disc, perhaps from an unknown source, simply press F1. Your IDE hard drive will become inaccessible to any nasties that may be inhabiting the suspect floppy. As soon as you know that the floppy is safe, press F2 to reinstate your hard drive. Just remember that you need to access the command line by pressing F12, before you press F1 or F2.

You can easily customise the program to work with other filing systems, such as SCSI, by changing idefs in lines 10 and 20 to SCSI or SCSIFS, depending on which system you use. It is not a good idea to change it to ADFS, as then you won't be able to access your floppy drive.


BASIC DEBUGGING
WimpDebug contains a set of three procedures which can be appended to any Basic program to assist with debugging. They are intended for use with Wimp programs, but can be used with non-Wimp programs by removing all references to VDU4 and 5. The simplest way to access them from your own program is to copy WimpDebug into your Library directory and then add the command LIBRARY %.WimpDebug at the start of your program.

They work by displaying the values of nominated variables on the Desktop background. This may be cleared of any unwanted printout at any time by just hitting F12, and pressing Return.

The first procedure, PROCdv, displays a single variable at a chosen position. It takes four parameters: x% and y% are PRINT TAB positions, s$ is the literal variable name (e.g. "counter%"), and v$ is the value, as a string (e.g. my_string$ or STR$counter%).

The second procedure, PROCdl, displays one or more variables, of any kind. Its single parameter is a comma-separated list, in quotes, for example:
  PROCdl("counter%,R$,FNstrip(s$),value")

The formatted output starts at the top left of the screen, and automatically includes both the name and the value of each variable. To display a numeric variable as hex, precede it with ~. A local error routine is used to report any errors, and space is provided for up to 21 variables in the list.

Note that PROCdl uses a number of local variables (e.g. sss%). If you use any of these in your program, and try to debug it you will get incorrect results.

The third procedure, PROCda, allows you to display array variables. It takes three parameters, a$, f%, and t%, where a$ is the literal name of the array (e.g. table$), and f% and t% are the first and last elements to show.

PROCda also uses local variables, so if you use them in your program, you will get incorrect results.


 Copyright RISC User 1993
