Code: Select all
do
a=a+1
key$=inkey$
if a = 100000
loop while key$=""
can someone help please
Code: Select all
do
a=a+1
key$=inkey$
if a = 100000
loop while key$=""
Code: Select all
do
a=a+1
key$=inkey$
if a = 100000 then goto finalselection else
loop while key$=""
Fine, then assuming you have a label elsewhere in the program called "finalselection", this code should work.RayBritton wrote:rights the correct code
a isn't declared as a specfic varible i just typed
a=0the a=0 isn't anywhere near is bit of codeCode: Select all
do a=a+1 key$=inkey$ if a = 100000 then goto finalselection else loop while key$=""
1.4Ghz isn't my machine is a customer(ish)'s machine
i'm using
* Operating system - Windows 98SE
* Language version - QB7.1
* Running interpreted or compiled -- sorry i didn't understand this one
You are forgetting LONGs.* In order to count up to 100,000, the variable "a" must be either SINGLE or DOUBLE, by default or explicitly defined.
Please puta isn't declared as a specfic varible i just typed
a=0
Code: Select all
DIM a AS LONG
Anyone can freely and legally download the QBASIC Interpreter (version 1.1) from:no i compile the program because other might not have qb
Try this... Using the TIMER function will do this.RayBritton wrote:i don't want to speed it up, i want to replace a=a+1 with something that will work indepent of the speed of the cpu
Code: Select all
'PQBC - Inkey$ Wait
'---------
do
a=a+1
red& = timer + (how ever long suits your program as a delay)
WHILE RED& > TIMER OR key$ <> ""
key$=inkey$
WEND
if a = 100000 then gosub finalselection
loop while key$=""
Code: Select all
'PQBC - Inkey$ Wait
'---------
do
a=a+1
red& = timer + (how ever long suits your program as a delay)
WHILE RED& > TIMER OR key$ <> ""
IF TIMER < 2 THEN
LET RED& = RED& - 86399
END IF
key$=inkey$
WEND
if a = 100000 then gosub finalselection
loop while key$=""