[futurebasic] Re: Break ... Until

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Al Staff <AlStaff@...>
Date: Sat, 27 Dec 1997 06:00:03 EST
My previous mail came through all garbled at my end so I'm sending again.
Sorry if you get 2 good copies (or 2 garbled ones if it happens again).


Try this. The FN commandPeriod was taken from PG Pro.

GLOBALS
DIM x
DIM programEnds
x=0
programEnds=0
END GLOBALS


' -----

LOCAL FN commandPeriod
 '---------------------------------------
 ' Return   zero if command-period is
 ' currently down.
 '---------------------------------------
 DIM keyRecord;16,doBreak
 doBreak = _false
 CALL GETKEYS(keyRecord)
 LONG IF FN BITTST(#@keyRecord,40)
  LONG IF FN BITTST(#@keyRecord,48)
   doBreak = _zTrue
  END IF
 END IF
END FN = doBreak

LOCAL FN beeper
 doBreak = 0
 DO
  BEEP : DELAY 250
  doBreak = FN commandPeriod
  LONG IF doBreak <> 0
   x = 1
   programEnds=1
  END IF
 UNTIL x=1
END FN

LOCAL FN handleBreak
 x=1
 programEnds=1
END FN

LOCAL FN doTimer
 FN beeper
END FN

' -----

ON BREAK FN handleBreak
ON TIMER(2) FN doTimer
DO
 HANDLEEVENTS
UNTIL programEnds


Al Staffieri Jr.

AlStaff@...
http://members.aol.com/AlStaff/index.html