Fw: Inkey and Sleep
Mike Fedko
filepro at adelphia.net
Mon Apr 11 19:23:44 PDT 2005
----- Original Message -----
From: "Bob Stockler"
> I no longer have any of the tread to which this belongs,
> but earlier I suggested a solution to the last problem
> posed in it, which was to test for the "acceptable" key
> strokes and loop if inkey didn't return one of them.
>
> At the time I didn't have the time to post an example of
> what I meant, but jut got a few free minutes and wrote one.
> I'm not sure how the original poster was using his routine,
> but this shows how to prevent the hangup he experienced:
>
> @MENU If:
> 1 Then: declare Lets ; Lets="abcdefghijklmnopqrstuvwxyz"
> 2 Then: declare Nums ; Nums="0123456789"
> 3 Then: declare Skys ; Skys="[ENTR][HELP]"
> 4 Then: sh=" 1" ; j="1" ; show popup "\n Waiting a while. \n "
> Loop If:
> 5 Then: show sh ; sleep "1000" ; xx(1,*)=inkey
> If: NOT Lets co xx and NOT Nums co xx and NOT Skys co @sk
> 6 Then: sh=sh { j ; goto Loop
> 7 Then: clearp ; show popup "\n Done Waiting. \n "
> 8 Then: show "Press \KZ to Quit: " ; wk=waitkey ; exit
>
> Note that INKEY will hold _only_ the key that was last pressed
> before it's executed.
>
> Bob
I copied this example to a processing table to test. The numlock, capslock,
F11,F12 etc... are all still freezing the processing, at least until the
enter key is pressed.
Mike Fedko
More information about the Filepro-list
mailing list