/* $VER: ABeat_Demoskript.rexx 1.4 (7.7.99) © by Nils Görs This script shows you all provided ARexx commands from ABeat. */ ABeat.exe = "ABeat" options results parse arg kommando IF kommando = "?" THEN DO OPTIONS PROMPT "BEAT/S,DATE/S,ALARM/S,SET/N,ON/S,OFF/S,GUI/S,STATUS/S,QUIT/S,TIME/S,GMTTIME/S: " PARSE PULL kommando IF kommando = "" THEN kommando = "BEAT" END IF SHOW(p,ABEAT) = 0 THEN DO ADDRESS COMMAND "run <>NIL:" ABeat.exe ADDRESS COMMAND "wait" END address ABEAT kommando = UPPER(kommando) WakeUpBeat = "500" IF ABBREV(kommando,"SET") THEN DO IF WORDS(kommando) >1 THEN DO WakeUpBeat = WORD(kommando,2) IF DATATYPE(WakeUpBeat) ~= "NUM" THEN WakeUpBeat = 500 END kommando = "SET" END SELECT WHEN kommando = "BEAT" THEN DO BEAT /* what's the beat? */ say "" IF result ~= "0000" THEN say "actual Beat: @"STRIP(result,L,0) ELSE say "actual Beat: @0" END WHEN kommando = "DATE" THEN DO DATE say result END WHEN kommando = "ALARM" THEN DO ALARM /* beat of your wake-up call */ BeatAlarm = result IF rc ~= 0 THEN EXIT IF BeatAlarm ~= "0000" THEN say "Wake-up call set to @"STRIP(BeatAlarm,L,0) ELSE say "Wake-up call set to @0" EXIT END WHEN kommando = "SET" THEN SET WakeUpBeat /* SET wake-up beat */ WHEN kommando = "ON" THEN ON /* ALARM ON */ WHEN kommando = "OFF" THEN OFF /* ALARM OFF */ WHEN kommando = "GUI" THEN ALARMGUI /* open requester! */ WHEN kommando = "STATUS" THEN DO STATUS /* alarm status! */ IF rc = 0 THEN say "wake-up call active." ELSE say "wake-up call inactive." END WHEN kommando = "QUIT" THEN DO id='req'pragma('id') address command 'rxset' id '`requestchoice TITLE=ABeat.rexx BODY="Really quit ABeat?" GADGETS="Yes|No"`' from_Shell=getclip(id) call setclip(id,'') IF from_Shell = 1 THEN QUIT END WHEN kommando = "TIME" THEN DO /* get local TIME */ TIME /* get TIME */ say "local time is:" result END WHEN kommando = "GMTTIME" THEN DO /* get GMT TIME */ GMTTIME /* get GMT TIME */ say "GMT time is:" result END OTHERWISE END