Qbasicnews.com

Full Version: Delay (doesn't exist)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
In some programs you get "Delay (xxxx)" but I can't find a version of QBASIC that understands it. Could someone please tell me something about "Delay (xxxx)"
Well, if you see "Delay(xxx)" in a program, it will most likely be a user created Subroutine. It is not a standard BASIC command.

basically it will call a sub that the programmer has created and feed in the xxx value.

Try using the TIMER keyword to work out how to make a delay routine based on seconds. If you get stuck or have problems, come back here and we will be happy to help.

Although there is a similar command, called SLEEP X
This halts the program for X seconds, but can be bypassed by pressing a key.
A delay in QB would be like either like this....

Code:
DELAY = 1000

DO
(Program Here)
FOR i = 1 TO DELAY
LOOP

Or like this...

Code:
TIMER = 0
DO
d = d + 1
LOOP UNTIL TIMER = 1
d = DELAY

DO
(Program Here)
FOR i = 1 TO DELAY
LOOP

The last one should give you a one second delay if I remember right, the first one you have to tweek a lil to get the right delay.. :wink:
OMG!!! This is SEVEN months old! Why are you digging up old threads?
You could also use SOUND 0, ticks
Quote:OMG!!! This is SEVEN months old! Why are you digging up old threads?

*checks* myeh.
Tt was dead -again- when you posted

...10 days =P
Quote:Tt was dead -again- when you posted
...10 days =P

>_<

The irony!
:oops: