WaitForTask V0.400 COPYRIGHT WaitForTask is Freeware, so anybody may use it without any charge. You are welcome to give this program to your friends, as long as you do not charge any money for it. All rights are reserved, because I'll certainly publish a modified version in a local computer magazine. WHAT IS IT ? The idea for this program came to me while talking to Walter Mildenberger, who said: "Self-detaching programs are stupid!" (Okay, those weren't his original words, but that's what he meant). We talked about the problem of waiting on such a program from the CLI. This is quite difficult because there is no possible way of finding out when the program finishes. This problem is solved now! WaitForTask scans Exec's task lists regularly and looks for a program name, which is specified when you run the program. WaitForTask will not return until this task exists! Using this command you can easily synchronise your scripts with self detaching programs. USAGE WaitForTask recognizes the following parameters: Taskname/A [Interval/N] [Reversed/S] [Delay/N] [PostDelay/N] Taskname - This argument is required! As you might guess from it's cleverly chosen name, this should be the name of the task/process WaitForTask waits for. How do you get the name of a task? The best way is to look for it using a tool like XOper, SystemSpy or AmigaRealTime-Monitor. If you want to find out the task name of a non-selfdetaching program you started with "RUN", the CLI-command "STATUS" might possibly help. WaitForTask understands and uses the CLI-wildcards of OS 2.xx! This is very useful if you do not know the exact name of a program! Additionally, some tools include their path in the task name, especially those you started with "RUN". In this case you should wait for "#?". The pattern matching is not case-sensitive. Interval - This optional parameter specifies the time interval that WaitForTask uses to scan the tasklist for the wanted name. The units are 1/50 seconds. For example, a value of 150 means that WaitForTask checks every three seconds (150/50=3). If you leave out this parameter, WaitForTask uses the default value of 3 seconds. Reversed - This is an optinal switch, which, when used, turns around the function of WaitForTask. It doesn't wait for a task to disappear, but for a task to appear. Using this switch, you may wait for a self-detaching program to be installed. Delay - This value specifies the time (in 1/50 seconds), that WaitForTask waits before it checks the task lists the first time. Using this feature, you can give a self-detaching program time to install itself completely. PostDelay - This is nearly the same as Delay, but this value is the time that WaitForTask delays before returning to the CLI, after the task it was waiting for has disappeared. If you ever get caught in a dead-lock, you can abort WaitForTask with CTRL+C or Shell's "BREAK"-command. There might be a small delay before this is recognised, depending on the test interval chosen. INSTALLATION All you have to do to install this wonderful program on your Amiga is to copy WaitForTask to your command path, preferably the "C:"-directory. WaitForTask is re-entrant and can be made resident. (You might have to set the PURE-bit first...) SYSTEM REQUIREMENTS WaitForTask requires OS V2.04 or higher. THE AUTHOR If you have any comments for me or just want to tell me that you hate my program, don't hesitate to connect me under one of the following addresses: Snail-Mail: Peter Simons E-Mail: simons@peti.GUN.de (Usenet) Europaring 20 2:242/7.25 (FIDO-Net) D-5300 Bonn 1 Germany Voice: Tel. 0228 / 746061