|
Loops
Aug 29, 2002 19:24:49 GMT
Post by Brendan on Aug 29, 2002 19:24:49 GMT
Hi I am pretty new to QBasic and have made a couple of small proggies but i am doing a loop and it is running to fast what i want to know is if there is a way to slow it down?
TIA
From Brendan
|
|
|
Loops
Aug 29, 2002 23:10:56 GMT
Post by programmer on Aug 29, 2002 23:10:56 GMT
There alot of ways to pause a loof like the SLEEP command. this command stops the whole program until a key is pressed or you can inenter this line
for num=1 to 10000 next
this makes qb count up to 10000 until it can keep going. you can also change the number to somethin smaller of larger
|
|
|
Loops
Aug 30, 2002 5:10:26 GMT
Post by brisray on Aug 30, 2002 5:10:26 GMT
There at least 4 ways to slow down a looping program Use TIMER, this is a good method for pausing or slowing down a program to intervals of around a quarter of a second. SLEEP, a method of pausing a program for a whole number of seconds. Useful when displaying "splash" screens. Do nothing loops, loops that simply count to a number then exit. This is not generally a good programming practice, but is an option. When using this method the results vary from computer to computer, but it is easy to implement. WAIT, a method of introducing a very small delay into a program. The &H3DA, 8 part waits for a screen refresh. Youcan see how each of these is implimented at members.lycos.co.uk/brisray/qbasic/qdelay.htmA bit of self advetising I know, but it's easier to see the code there than for me to put the whole thing here. Ray
|
|
|
Loops
Aug 30, 2002 6:33:39 GMT
Post by Brendan on Aug 30, 2002 6:33:39 GMT
Thanks guys!!!
|
|
|
Loops
Sept 16, 2002 4:37:37 GMT
Post by Dave on Sept 16, 2002 4:37:37 GMT
Or try using quickbasic extended it has trace that slows down the program run. It also makes exe files out of your bas files. I downloaded if free off the web.
|
|