home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / software / utilities / abeat / abeat.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-07-05  |  1.8 KB  |  77 lines

  1. /*
  2.    $VER: ABeat_Demoskript.rexx 1.3 (5.7.99) © by Nils Görs
  3.  
  4.    This script shows you all provided ARexx commands from ABeat.
  5. */
  6.  
  7. ABeat.exe = "ABeat"
  8.  
  9. options results
  10.  
  11. parse arg kommando
  12.  
  13. IF kommando = "?" THEN DO
  14.     OPTIONS PROMPT "BEAT/S,DATE/S,ALARM/S,SET/N,ON/S,OFF/S,GUI/S,STATUS/S,QUIT/S,TIME/S,GMTTIME/S: "
  15.     PARSE PULL kommando
  16.  IF kommando = "" THEN kommando = "BEAT"
  17. END
  18.  
  19. IF SHOW(p,ABEAT) = 0 THEN DO
  20.     ADDRESS COMMAND "run <>NIL:" ABeat.exe
  21.     ADDRESS COMMAND "wait"
  22. END
  23. address ABEAT
  24.  
  25. kommando = UPPER(kommando)
  26.  
  27. SELECT
  28.     WHEN kommando = "BEAT" THEN DO
  29.         BEAT                /* what's the beat? */
  30.         say ""
  31.         IF result ~= "0000"    THEN say "actual Beat: @"STRIP(result,L,0)
  32.                     ELSE say "actual Beat: @0"
  33.     END
  34.  
  35.     WHEN kommando = "DATE" THEN DO
  36.         DATE
  37.         say result
  38.     END
  39.  
  40.     WHEN kommando = "ALARM" THEN DO
  41.         ALARM                /* beat of your wake-up call */
  42.         BeatAlarm = result
  43.         IF rc ~= 0 THEN EXIT
  44.  
  45.         IF BeatAlarm ~= "0000" THEN  say "Wake-up call set to @"STRIP(BeatAlarm,L,0)
  46.                     ELSE say "Wake-up call set to @0"
  47.         EXIT
  48.     END
  49.  
  50.     WHEN kommando = "SET" THEN SET 555    /* SET wake-up beat */
  51.     WHEN kommando = "ON" THEN ON        /* ALARM ON */
  52.     WHEN kommando = "OFF" THEN OFF        /* ALARM OFF */
  53.     WHEN kommando = "GUI" THEN ALARMGUI    /* open requester! */
  54.     WHEN kommando = "STATUS" THEN DO
  55.         STATUS    /* alarm status! */
  56.         IF rc = 0 THEN say "wake-up call active."
  57.             ELSE    say "wake-up call inactive."
  58.     END
  59.     WHEN kommando = "QUIT" THEN DO
  60.         id='req'pragma('id')
  61.         address command 'rxset' id '`requestchoice TITLE=ABeat.rexx BODY="Really quit ABeat?" GADGETS="Yes|No"`'
  62.         from_Shell=getclip(id)
  63.         call setclip(id,'')
  64.         IF from_Shell = 1 THEN QUIT
  65.     END
  66.     WHEN kommando = "TIME" THEN DO        /* get local TIME */
  67.         TIME    /* get TIME */
  68.         say "local time is:" result
  69.     END
  70.     WHEN kommando = "GMTTIME" THEN DO    /* get GMT TIME */
  71.         GMTTIME    /* get GMT TIME */
  72.         say "GMT time is:" result
  73.     END
  74.  
  75.     OTHERWISE
  76. END
  77.