tcl.alarm Verb: Access/TCL

tcl.alarm

Command tcl.alarm Verb: Access/TCL
Applicable release versions: AP/Unix
Category TCL (746)
Description schedules a task at a given time, or after a given delay in seconds, at a given date .

If "date" is not specified, the current date is used. If an asterisk (*) is used as a date, the command will be executed every day, at the specified time.

If "command" is not specified, the options apply to the "alarm" command itself. If command is specified, the options are part of the command.

If "command" starts with an asterisk (*), it is assumed to be simple text, which will be displayed on the user's terminal when the alarm expires.

The alarm signal handler must be set to "useralarm" by the "trap" command.

If no option or command is given, the Update processor is entered to add/change/review alarms.

If an input with time out is done after the alarm has been set, the alarm is suspended for the duration of the wait and restarted for whatever remaining time. Any command which should have been executed during the wait is postponed until the input with time out is done.

The alarm is run by the current process. If an event should have been executed while the process executes a TCL sleep command, it is cancelled. If an alarm occurs while the user is logged off, it is discarded.

The alarm can run as long as the process is not disconnected. To be sure, however, the "alarm (s" command, without any argument, should be included in the user macro to restart the alarm every time the user logs in.

If the alarm handler is not set properly, "alarm" will complain.
The trap handler can be set by the command:
:trap alrm run dm,bp, useralarm
Syntax alarm {delay{,date} {command}} {(options}
alarm {delay{,*} {command}} {(options}
alarm {hh:mm{:ss}{,date} {command}} {(options}
alarm {hh:mm{:ss}{,*} {command}} {(options}
Options c Cancels all currently scheduled tasks for the user.

l Lists currently scheduled tasks for the user.

s Sets current alarms. This option simply re-arms the alarm. It should be included in every user macro to start the alarm every time a user logs in.
Example
alarm 18:00 * File save is starting
Sets an alarm for 18:00 (6:00 p.m.), today. At this time, if the process is 
still logged on, the text 'File save is starting' will be displayed 
on the user's terminal. 

alarm 120 off
In 120 seconds, the process is logged off. This command could be included in a 
PROC, to make sure an input screen will not wait forever for an input. When the 
input is complete, "alarm (c" will clear the time out. 

alarm 09:00,12/03 display Meeting time.
At 9 o'clock, on December the 3rd, "Meeting time" displays.

alarm 17:00,* msg * File save in 30 minutes
Every day, at 17:00, the message command will be executed.

alarm
This enters the Update processor to edit the user alarm item.

alarm (l
List currently scheduled events. 

alarm (s
This displays the next scheduled event, and starts the alarm. This command 
should be included in the users' macros, so that the alarm is refreshed 
every time a user logs in.
Purpose
Related tcl.trap
tcl.sleep