home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / COUNTDWN.OPL < prev    next >
Text File  |  1992-04-19  |  736b  |  38 lines

  1. REM +-----------------------+
  2. REM Author  Jon Simpson   
  3. REM Title                  
  4. REM Date      
  5. REM +-----------------------+
  6. PROC CountDwn:
  7.     LOCAL min&, sec&, secs&, i%,inchr%
  8.  
  9.   inchr%=255
  10.   WHILE inchr%<>0
  11.      dINIT "Countdown Timer"
  12.      dLONG min&, "Minutes",0,&7FFFFFFF/60-1
  13.      dLONG sec&, "Seconds",1,59
  14.      dBUTTONS "Cancel",-27,"Start",13
  15.      inchr% =  DIALOG
  16.      IF inchr%=13
  17.        SCREEN 10,4,1,1
  18.        gSETWIN 100,20,40,36
  19.        gBORDER 0
  20.        secs&=sec&+60*min&
  21.        WHILE secs&
  22.         gCLOCK OFF
  23.       gAT 2,2
  24.         secs&=secs&-1
  25.         gCLOCK ON,3,-((HOUR*60)+MINUTE)+secs&
  26.         PAUSE 20
  27.        ENDWH
  28.        
  29.        i%=0
  30.        DO
  31.         BEEP 1,300-(2*i%)
  32.         PAUSE 10
  33.         i%=i%+1
  34.        UNTIL i%=5
  35.       ENDIF
  36.  ENDWH
  37. ENDP
  38.