03-28-2005, 03:03 AM
Hi I have a little code problem in Qbasic and wonder if anyone know the solution. I made a trivia program for school. It's nearly complete except for this one problem. Here is the part of my code that has a problem. (in Bold)
I put the sleep command there because by doing so I can allow user to press any key to continue to the next screen. It works well other than the fact that the first INPUT command after the sleep command won't work. It display the question there but doesn't allow you to input anything. The second input works but I don't want to use it because its sort of faulty coding and going to cost me marks. I tried a number of different ways but couldn't find out why this is happening. Anyone know how to solve it? Thanks alo
Quote:'***************************************************************************
'INPUT
SLEEP
SCREEN 0
WIDTH 80
CLS
COLOR 12
LOCATE 6, 20
INPUT "Hello there, please enter your name:", username
LOCATE 7, 20
INPUT "Enter your name here please:", username
LOCATE 8, 20
PRINT "Thank you "; username
LOCATE 9, 20
I put the sleep command there because by doing so I can allow user to press any key to continue to the next screen. It works well other than the fact that the first INPUT command after the sleep command won't work. It display the question there but doesn't allow you to input anything. The second input works but I don't want to use it because its sort of faulty coding and going to cost me marks. I tried a number of different ways but couldn't find out why this is happening. Anyone know how to solve it? Thanks alo