home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / clarion / library / delay / delay.cla
Text File  |  1991-11-30  |  2KB  |  75 lines

  1. DELAY        Program            ! 10/6/91 - James Portanova
  2.                 !           HOT PROPERTIES SOFTWARE
  3.                 !           Post Office Box 437
  4.                 !           Fresh Meadows, New York 11365-0437
  5.                 !
  6.                 !       Demonstrates how to implement a delay
  7.                 !       in program execution based upon ticks
  8.                 !       of the system clock.
  9.                 !
  10.          MAP
  11.            Proc(MAIN)
  12.          .
  13.          Group,Pre(MEM)
  14. Starting       Long
  15. Ending         Long
  16. Seconds        Byte
  17.          .
  18.  
  19.   CODE
  20.   BLANK
  21.   MAIN
  22.   RETURN
  23.  
  24. MAIN         PROCEDURE
  25. SCREEN       Screen       Pre(SCR),Hue(7,0)
  26.            Row(18,21) Paint(1,39),Hue(31,0)
  27.            Row(15,41) Paint(1,10),Hue(0,7)
  28.            Row(16,41) Paint(1,11),Hue(15,0)
  29.            Row(8,19)  String('╔═{40}╗')
  30.            Row(9,19)  Repeat(10);String('║<0{40}>║') .
  31.            Row(19,19) String('╚═{40}╝')
  32.            Row(10,31) String('DELAY DEMONSTRATION')
  33.            Row(14,26) String('STARTING TIME:')
  34.            Row(15,28) String('ENDING TIME:')
  35.            Row(16,31) String('TIME NOW:')
  36.          Col(41)  Entry,Use(?FIRST_FIELD)
  37.            Row(12,24) String('Enter Seconds to Delay (1-60)')
  38.          Col(54)  Entry(@N2.0),Use(MEM:Seconds),Hue(15,0),Sel(0,7),Ins |
  39.                 Req,Num
  40.          Col(57)  Entry,Use(?LAST_FIELD)
  41.          .
  42.  
  43.   CODE
  44.   OPEN(SCREEN)
  45.   SETCURSOR
  46.   DISPLAY
  47.   LOOP
  48.     ACCEPT
  49.     CASE FIELD()
  50.     OF ?FIRST_FIELD
  51.       IF KEYCODE() = 256 THEN RETURN.
  52.  
  53.     OF ?MEM:Seconds
  54.       IF ~INRANGE(MEM:Seconds,1,60)
  55.     BEEP(600,10)
  56.     CLEAR(MEM:Seconds)
  57.     SELECT(?MEM:Seconds)
  58.     CYCLE
  59.       .
  60.       MEM:Starting = CLOCK()
  61.       MEM:Ending = MEM:Starting + (MEM:Seconds*100)
  62.       SHOW(14,42,MEM:Starting,@T4)
  63.       SHOW(15,42,MEM:Ending,@T4)
  64.     LOOP
  65.       SHOW(16,42,CLOCK(),@T4)
  66.       IF CLOCK() >= MEM:Ending THEN BEEP(600,10);BREAK.
  67.     .
  68.       SHOW(18,29,'Press Enter to Restart')
  69.       ASK
  70.       CLEAR(MEM:Seconds)
  71.       RESTART(Main)
  72.  
  73.   . .
  74.  
  75.