08-06-2003, 02:36 AM
lol, i could think of a good name for this thread...
anyway, here's my question- i made a program to get characters from the user, and randomly displays them on the screen 2147483648 times- i was origionally trying to do a sort of 'matrix intro' thing, with the green numbers and characters scrolling.
It was working just great until i added a way to exit the while loop ( IF (INKEY$ = "q") THEN GOTO ec ), when i added that, it still runs in the Qbasic editor, but when i make it a standalone .exe file, after about 5 seconds of running, the characters stop printing on the screen as fast as they had been. If i hit any key other than q, it speeds up again for the same interval of time. So my guess is that the inkey check is holding up the program?
Another thing of note is this line:
WHILE (endless& <= 2147483648#)
i didn't put the # there- when i ran the program inside the editor, when i was done running it, the # was there- what's with that?
Here's the code in it's entirety, thanks for the help
CLS
SCREEN 0
COLOR 10, 0
PRINT "______________________________________"
PRINT "|------------------------------------|"
PRINT "|The Cascading Characters of Doom!!!!|"
PRINT "|------------------------------------|"
PRINT
INPUT "How many characters in the set"; char%
DIM choice$(char%)
FOR ctr = 1 TO char%
CLS
PRINT "______________________________________"
PRINT "|------------------------------------|"
PRINT "|The Cascading Characters of Doom!!!!|"
PRINT "|------------------------------------|"
PRINT "Enter character number "; ctr;
INPUT " ", choice$(ctr)
NEXT ctr
RANDOMIZE TIMER
endless& = 0
count& = 0
WHILE (endless& <= 2147483648#)
count& = count& + 1
IF (count& <= 80) THEN
ran% = INT(RND * (char% - 1 + 1)) + 1
PRINT choice$(ran%);
END IF
IF (count& > 80) THEN
PRINT
count& = 0
END IF
endless& = endless& + 1
IF (INKEY$ = "q") THEN GOTO ec
WEND
ec:
CLS
END
anyway, here's my question- i made a program to get characters from the user, and randomly displays them on the screen 2147483648 times- i was origionally trying to do a sort of 'matrix intro' thing, with the green numbers and characters scrolling.
It was working just great until i added a way to exit the while loop ( IF (INKEY$ = "q") THEN GOTO ec ), when i added that, it still runs in the Qbasic editor, but when i make it a standalone .exe file, after about 5 seconds of running, the characters stop printing on the screen as fast as they had been. If i hit any key other than q, it speeds up again for the same interval of time. So my guess is that the inkey check is holding up the program?
Another thing of note is this line:
WHILE (endless& <= 2147483648#)
i didn't put the # there- when i ran the program inside the editor, when i was done running it, the # was there- what's with that?
Here's the code in it's entirety, thanks for the help
CLS
SCREEN 0
COLOR 10, 0
PRINT "______________________________________"
PRINT "|------------------------------------|"
PRINT "|The Cascading Characters of Doom!!!!|"
PRINT "|------------------------------------|"
INPUT "How many characters in the set"; char%
DIM choice$(char%)
FOR ctr = 1 TO char%
CLS
PRINT "______________________________________"
PRINT "|------------------------------------|"
PRINT "|The Cascading Characters of Doom!!!!|"
PRINT "|------------------------------------|"
PRINT "Enter character number "; ctr;
INPUT " ", choice$(ctr)
NEXT ctr
RANDOMIZE TIMER
endless& = 0
count& = 0
WHILE (endless& <= 2147483648#)
count& = count& + 1
IF (count& <= 80) THEN
ran% = INT(RND * (char% - 1 + 1)) + 1
PRINT choice$(ran%);
END IF
IF (count& > 80) THEN
count& = 0
END IF
endless& = endless& + 1
IF (INKEY$ = "q") THEN GOTO ec
WEND
ec:
CLS
END