home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsf / geteva / GETEVA.OPL < prev   
Text File  |  1992-06-24  |  912b  |  51 lines

  1. PROC geteva:
  2.     local t%,j&,t&
  3.     local m%,s%,e&,o&,s&,tint&
  4.     local restart%
  5.     local tcb%,tstat%
  6.     local cstat%,k%(2)
  7.     ioopen(tcb%,"TIM:",-1)
  8.     ioa(-2,14,cstat%,k%(1),#0)
  9.     tstat%=-46
  10.     while 1
  11.         iowait
  12.         if tstat%<>-46
  13.             call($078b,0,10,0,$41c,addr(t%))
  14.             tint&=10-((t% and $1f)*10)/32
  15.             ioa(tcb%,1,tstat%,tint&,#0)
  16.             if restart%
  17.                 restart%=0
  18.                 s&=t&
  19.             endif
  20.             e&=o&+t&-s&
  21.             m%=e&/60
  22.             s%=e&-m%*60
  23.             at 30,9
  24.             if m%<10
  25.                 print " ";
  26.             endif
  27.             print m%;":";
  28.             if s%<10
  29.                 print "0";
  30.             endif
  31.             print s%;
  32.         else
  33.             if k%(1)=$402 or k%(1)=$403
  34.                 o&=e&
  35.                 iow(tcb%,4,#0,#0) :rem cancel timer
  36.                 iowaitstat tstat%
  37.                 tstat%=-46
  38.             endif
  39.             if k%(1)=$401 or k%(1)=$403
  40.                 restart%=1
  41.                 tstat%=0
  42.                 iosignal
  43.             elseif k%(1)>=%a and k%(1)<=%z
  44.                 at 1,1
  45.                 print "Received key",chr$(k%(1))
  46.             endif
  47.             ioa(-2,14,cstat%,k%(1),#0)
  48.         endif
  49.     endwh
  50. ENDP
  51.