Non blocking INPUT?
Mickster
Posts: 2,698
Been a while since I used FlexBasic but I thought we had a way of checking for a character waiting in the keyboard buffer before grabbing it?
I use lots of Basics so maybe I'm confused.
Craig
Comments
@Mickster : We don't have a non-blocking INPUT, or really anything like it at the high level (i.e. which can work with arbitrary files).
For just the keyboard, there is a low level (undocumented) function to read with a timeout:
If you give a timeout of zero (so
_rxraw(0)
) then it will return immediately with -1 if there is no key available, otherwise it returns the key.@ersmith
Hi Eric,
In my case, a
_rxraw(0)
blocks but_rxraw(-1)
works beautifully. Many thanksCraig