home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1B / DATAFILE_PDCD1B.iso / _pocketbk / pocketbook / 004 / oplexamp_z / ALM.OPL < prev    next >
Text File  |  1992-08-26  |  640b  |  25 lines

  1. PROC alm:
  2. LOCAL h%,a&(2),a$(64),b$(65),d&,t&,t2&,a%,r%,s%
  3. r%=IOOPEN(h%,"ALM:",0)
  4. IF r%<0 :RAISE r% :ENDIF
  5. d&=DAYS(DAY,MONTH,YEAR) REM today
  6. t&=DATETOSECS(1970,1,1,HOUR,MINUTE,0)
  7. DINIT "Set alarm"
  8. DTIME t&,"Time",0,0,DATETOSECS(1970,1,1,23,59,59)
  9. DDATE d&,"Date",d&,DAYS(31,12,2049)
  10. DTIME t2&,"Alarm advance time",2,0,86399
  11. DEDIT a$,"Message"
  12. IF DIALOG
  13.     a&(2)=86400*(d&-25567)+t&
  14.     a&(1)=a&(2)-t2&
  15.     b$=a$+CHR$(0)
  16.     a%=ADDR(b$)
  17.     r%=IOA(h%,2,s%,a&(),#a%+1)
  18.     IF r%<0 :RAISE r% :ENDIF
  19. ENDIF
  20. r%=IOCLOSE(h%)
  21. IF r%<0 :RAISE r% :ENDIF
  22. ENDP
  23.  
  24.  
  25.