home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / INQALM.OPL < prev    next >
Text File  |  1992-10-06  |  2KB  |  82 lines

  1. PROC inqalm:
  2.     global TimPid%
  3.     local DatAct%
  4.     local next%
  5.     local typ%
  6.     local alminfo%(50)
  7.     TimPid%=fTimPid%:
  8.     DatAct%=fDatAct%:
  9.     Fetch:(DatAct%,addr(next%),2)
  10.     while next%<>DatAct%
  11.         Fetch:(next%,addr(alminfo%()),100)
  12.         next%=alminfo%(1)
  13.         print "*** Alarm for Process ID $";hex$(alminfo%(4))
  14.         print "  Will ring at -",
  15.         printd:(addr(alminfo%(6)),1)
  16.         typ%= alminfo%(5) and $ff
  17.         if typ%
  18.             print "  Alarm with text:"
  19.             prints:(addr(alminfo%(15)))
  20.             print "  Appointment at -",
  21.             printd:(addr(alminfo%(8)),typ%)
  22.         else
  23.             print "  Clock alarm"
  24.         endif
  25.         get
  26.     endwh
  27.     print "No more alarms queued"
  28.     get
  29. ENDP
  30.  
  31. PROC fTimPid%:
  32.     local ssname$(8)
  33.     ssname$="*.$06"+chr$(0)
  34.     return call($0188,addr(ssname$)+1,0,0,0,0)
  35. ENDP
  36.     
  37. PROC fDatAct%:
  38.     local DatLook%(4)
  39.     local offset%
  40.     local buf%(128)
  41.     Fetch:($a00,addr(buf%()),256)
  42.     DatLook%(1)=1+2*256
  43.     DatLook%(2)=4+8*256
  44.     DatLook%(3)=16+32*256
  45.     DatLook%(4)=64
  46.     offset%=call($a9,8,256,0,addr(buf%()),addr(DatLook%()))
  47.     return($a00+offset%+12)
  48. ENDP
  49.  
  50. PROC Fetch:(poff%,buf%,blen%)
  51.     call($91,TimPid%,blen%,0,poff%,buf%)
  52. ENDP
  53.  
  54. PROC prints:(buf%)
  55.     local almmess$(64)
  56.     scpy:(addr(almmess$)+1,buf%)
  57.     pokeb addr(almmess$),slen%:(buf%)
  58.     almmess$=chr$(34)+almmess$+chr$(34)
  59.     print "  ";almmess$
  60. ENDP
  61.  
  62. PROC scpy:(di%,si%)
  63.     call($ac,0,0,0,si%,di%)
  64. ENDP
  65.  
  66. PROC slen%:(di%)
  67.     return call($b9,0,0,0,0,di%)
  68. ENDP
  69.  
  70. PROC printd:(buf%,typ%)
  71.     local yr%,mo%,dy%,hr%,mn%,sc%,yrday%
  72.     secstodate peekl(buf%),yr%,mo%,dy%,hr%,mn%,sc%,yrday%
  73.     if typ%=1
  74.         print hr%;":";
  75.         if mn%<10
  76.             print "0";
  77.         endif
  78.         print mn%;",",
  79.     endif
  80.     print dy%;"/";mo%;"/";yr%
  81. ENDP
  82.