03-28-2005, 10:42 PM
Hi, I want to make an unique input style where the user has a few seconds to make an input in a trivia sort of program before one of the choices get deleted and user lose a mark for that. I almost suceed in doing it but after nearly 2 hours of debugging, it doesn't work the way I want.
Here is the part of my code that I can't figure out how to do it:
That's what it suppose to work like. The problem is that it doesn't work at all no matter what I tried. I get the same results if I press any keys or if I don't press any at all. Anyone know what's wrong with it? Thanks alot.
[/i]
Here is the part of my code that I can't figure out how to do it:
Code:
PRINT "Trivia Question Number 1"
PRINT "Each choice = 4 marks. "
PRINT "Most graphic editing professionals use which of the following"
PRINT "programs to edit their work?"
fchoice$(1) = "A. Adobe Photoshop"
fchoice$(2) = "B. Jasc Paintshop Pro"
fchoice$(3) = "C. Microsoft Paint"
fchoice$(4) = "D. Adobe Photoshop Element"
FOR K = 1 TO 4
PRINT fchoice$(K) 'Where I list my choices
NEXT K
SLEEP 5 'Give the user 5 secs to answer
inputkey$ = INKEY$
IF inputkey$ <> "" THEN
INPUT "Please enter your choice"; choice$
IF choice$ = "a" then
PRINT whatever I want
'If the user press any key during the 5 seconds, the INPUT dialogue will pop up to ask user for choice selection.
ELSEIF inputkey$ = "" THEN
FOR K = 1 TO 3
PRINT fchoice$(K)
NEXT K
'If the user doesn't press any key during the 5 seconds, one of the choices will be deleted and the user loses a mark but has 2 more choice to answer before he gets a zero.
END IF
That's what it suppose to work like. The problem is that it doesn't work at all no matter what I tried. I get the same results if I press any keys or if I don't press any at all. Anyone know what's wrong with it? Thanks alot.
[/i]