John's Software

Software for RISC OS Computers Only


  TaskCheck 0.4

Syntax: TaskCheck <taskname> [<command>]

This is a small (855 byte) BASIC utility which can be called from a Run file to check if a specified task is running or not.

It can be called with just a taskname as a single parameter, when, if the task is present in the Task Manager's list of running tasks, the program halts with an error report.

If the task is not running, it returns without doing anything.

Thus the utility can provide a simple way of avoiding multiple copies of applications being loaded where this is undesirable.

The task name, exactly as appears in the Task Manager window, is passed to the utility as a single parameter. If the taskname contains a genuine space, it should be enclosed in quotes.

Thus, to check if your program task called 'MyProg' was running, your Run file would call '<MyProg$Dir>.TaskCheck MyProg', assuming the application name was !MyProg. The utility would be located in your application's own directory.

A second parameter can be added in the form of a valid OS command, in which case this will be passed to the OS if the task is not already running. The error box described above if the task is already running is suppressed when this second parameter is present.

Thus the command could, for example, be used to ensure that a particular task is running in a similar way to how the RMEnsure command is used for module tasks.

Running TaskCheck without any parameters, say by double-clicking on it, now gives a message giving the version number and syntax.

Download from here