INKEY$ BUG - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: INKEY$ BUG (/thread-6208.html) |
INKEY$ BUG - GordonSweet - 02-23-2005 If you have tried any of my patterns programs I posted, and those involving playing MOD/MID files you may have noticed the INKEY$ functions sometimes only allows you to abort the program during the first few seconds or so. So there must be a bug in FB, because the patterns all abort with QB at anytime. Has anyone found a solution to the problem? Gordon INKEY$ BUG - Antoni Gual - 02-24-2005 Perhaps the problem is in the way you exit the GOSUB when the key is pressed. Code: IF INKEY$ <> "" THEN GOTO done Then, if you don't save the pressing of the key in a flag, the user will have to press the key a second time to exit the main loop and another one to end the SLEEP at the end of the program. I hope it helps. INKEY$ BUG - GordonSweet - 02-24-2005 Thanks for your advice Antoni, but no luck. As you can see I have now made sure to close the remaining For Next and While Wend loops when aborting. But if you compile this program with FB and run it, you have only about 20 seconds to press the space bar or it is back to the dreaded Al+Ctrl+del to terminate. There is no such probem if compiled with QuickBasic Gordon Code: DEFSNG A-Z INKEY$ BUG - Antoni Gual - 02-25-2005 Gordon: I think you are right, it does'nt react to INKEY$ The program seems to not read keys with INKEY$. I changed your key test to IF LEN(INKEY$) THEN , it should react to ANY key, and it reacts only to a mouse click to the close button (that translates to the keys chr$(255)+"X") and gives an error when closing However if I change the condition to IF MULTIKEY(1) THEN (reacting to the escape key) the program works correctly. Lillo? INKEY$ BUG - GordonSweet - 02-25-2005 Thanks again Antoni, You have cracked the problem, but I can find no mention of MULTIKEY in either the QB, QuickBasic or the FB keywords.txt. I have had to put a note to hold the Esc key down until accepted. One final bug in the KALIEDSCOPE Mod/Mid player is the list of files fails to show after a few re-starts. Gordon INKEY$ BUG - ShadowWolf - 02-25-2005 Multikey is listed in lillo gfx txt file should be with the lastest package of FB |