[futurebasic] INKEY$

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

From: Stewart <stharris@...>
Date: Sat, 30 Oct 1999 10:52:40 -0400
This problem must be easy, but I don’t see the solution.

This works in FB II but not FB^3:

CLEAR LOCAL MODE
DIM 2 key$
LOCAL FN Pause (msg$)
   PRINT msg$
   PRINT "Press any key …"
   DO
      key$ = INKEY$
      IF LEN(key$) then PRINT key$
   UNTIL key$
END FN

Neither does this:

CLEAR LOCAL MODE
DIM 2 key$
LOCAL FN Pause (msg$)
   PRINT msg$
   PRINT "Press any key …"
   DO
      key$ = INKEY$
      IF key$ = "x" then PRINT key$
   UNTIL key$ = "x"
END FN

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