[futurebasic] Re: [FB] INKEY$

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: MacMuse@...
Date: Sat, 30 Oct 1999 15:57:59 EDT
In a message dated 10/30/99 10:53:25 AM, stharris@... writes:

<< The manual says that INKEY$ doesn�t work in FB^3 and that

_evKey should be used, but I don�t know how to use it

to tell the runtime to break out of the loop and leave the function.


I could use a small example.


Thanks in advance, Stewart >>

Stewart, I'm assuming you just want your program to wait until the user 
presses a key (or specifically "x") If so, try it like this.

LOCAL FN bldWnd
  WINDOW _MyWnd, "", (0,0)-(300, 300), _doc
  PRINT "Press any key �"
  'or better yet, use an EDIT FIELD#
END FN

LOCAL FN doDialog
  evnt = DIALOG(0)
  id = DIALOG(evnt)
  SELECT WINDOW (_activeWnd)
    CASE _myWnd
      SELECT evnt
        CASE _evKey
          'check for specific key if you wish
          'close wnd or do whatever you want 
      END SELECT    'evnt
  END SELECT         'activeWnd
END FN

'----------- MAIN --------
FN bldWnd

ON DIALOG FN doDialog

'regular HANDLEEVENTS loop here

HTH

Roger M. Clary
MacMUSE Software
MacMuse@...
http://members.aol.com/macmuse