/******************************************************************* * ARexx Script: Alarmist_Warn.rexx * * ---------------------------------------------------------------- * * This script can be used in the Alarmist as a Pre-Warn. * * Just select this script in the Warn Configuration and select * * the execution type as 'ARexx.' * * This example queries Alarmist for its next alarm. If there is * * one then the script informs the user of the name and time of the * * event via the program 'Talk.' * * You could even assign this script to a Hot-Key in Tool Manager * * to find out when the next even will occur. * *******************************************************************/ options results getnextalarm nextalarm = result /* if there isn't a 'next' alarm then quit */ if (nextalarm = 0) then do address command c:talk no more a larms for today exit(0) end /* get computer time */ clock_minutes = time(m); /* make next alarm active in list */ active alarm /* get name */ getfield 1 name = result /* get hour */ getfield 3 hour = result /* get minute */ getfield 4 minute = result alarm_minutes = hour * 60 + minute /* calculate difference between alarm and computer time */ diff_minutes = alarm_minutes - clock_minutes diff_hours = diff_minutes % 60 diff_minutes = diff_minutes // 60 output = '' /* put together the output string */ if (diff_hours > 0) then do output = '%n'diff_hours' hour' if (diff_hours > 1) then output = output || 's' end if (diff_minutes > 0) then do output = output '%n'diff_minutes' min ut' if (diff_minutes > 1) then output = output || 's' end /* Talk to the user */ address command 'c:talk ->2 'name' will a cur in 'output /* It's as easy as that ! */