home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
arexx
/
misc_arexx
/
reminder.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-22
|
3KB
|
154 lines
/*
GiGA Time Reminder ©96 by Fini 'Warp' Alring of GiGA Productions...
*/
Xver = 'v1.2'
Parse arg ARGS
Argnum=Arghandler(ARGS)
OPT = arg.1
TIMO = arg.2
Call initlibs
if Argnum=0 | length(TIMO) ~= 5 | substr(TIMO,3,1) ~= ':' then do
say ''
say centre(' GiGA Time Reminder ' || Xver,80)
say centre('Created by Fini "Warp" Alring of GiGA Prod. ©1996',80)
say ''
say centre('This util Sleeps in the back, and pops up a message requester!',80)
say ''
say centre('Usage: Run >NIL: Rx Reminder -Option [Optional Message in alert]',80)
say ' Options:'
say ' -a 01:24 -> Alert after 1 hour, and 24 minutes.'
say ' -t 22:35 -> Alert at 22:35 today!'
say ''
exit(0)
end
Message = ''
i=3
do i=3 to Argnum
Message = Message || ' ' || arg.i
end
/* Options Begin here! */
if upper(OPT) = '-A' then do
Call Snooze(left(TIMO,2),right(TIMO,2))
if argnum=2 then arg.3 = 'You called, master...?'
if length(message)<17 then message = centre(message,18)
Call Popreq(message)
end
if upper(OPT) = '-T' then do
ok=0
req_hour = substr(TIMO,1,2)
req_minu = substr(TIMO,4,2)
do while TIMO ~= Substr(Time('Normal'),1,5)
Call delay(30 * 50)
end
if argnum=2 then arg.3 = 'You called, master...?'
if length(message)<17 then message = centre(message,18)
Call Popreq(message)
end
exit(0)
/* Functions - Begin */
Arghandler: Procedure Expose arg.
ARGS = arg(1)
l=words(ARGS)
do a=1 to l
arg.a = word(ARGS,a)
end a
return l
/* ^- Argument handler. */
Initlibs: Procedure
a=0
If exists('LIBS:rexxreqtools.library') ~= 1 then do
Say 'Unable to open rexxreqtools.library'
a=1
end
If exists('LIBS:reqtools.library') ~= 1 then do
Say 'Unable to open reqtools.library'
a=1
end
If exists('LIBS:rexxsupport.library') ~= 1 then do
Say 'Unable to open rexxsupport.library'
a=1
end
if a=1 then do
say 'Unable to run:'
say Title
say 'Get the libraries listed above, you will need them/it...'
exit(20)
end
call addlib("rexxsupport.library", 0, -30, 0)
call addlib("rexxreqtools.library", 0, -30, 0)
/* ^- Libs R found, now we link the reqtools.lib via rexxreqtools.lib */
Return 0
/*
** ^- Check for needed libraries, and react upon...
*/
Snooze: Procedure
arg Hours, Minutes
Tsec = ( ( Hours * 60 ) + Minutes ) * 60
Call Delay( Tsec * 50 )
return 0
/*
** ^- Delay(H,M)
*/
PopReq: Parse arg MESS
say d2c(7)
call delay(10)
say d2c(7)
s = 'Reminder ' || Xver || '©96 GiGA Prod. '
Call RTezrequest(MESS,'Done!',s,"rt_reqpos =reqpos_centerscr")
return 0
/*
** ^- Pop a requester, with a message...
*/