Return to Index  

...

May 28 2003 at 5:39 PM
GreenMan 
from IP address 64.162.11.98


Response to .

 

It did a good job of getting me confused! GOTO's tend to do that. You don't need LET either. I cleaned up the mess a little.

The trick is to get the thing to run at the same speed regardless of the machine it's running on. The smallest increment TIMER will return is 1/18.2 seconds (but it isn't that exact). I tested this with two computers side by side, a 486 66 running QB 1.1 under pure DOS, and a P2 233 running QB 7.1 under win 98. (What can I say -- I collect antiques). You would think the test loop would set the delay for the same length, but it doesn't, quite. Pretty close, though. Still better than hardcoding the delay length.

SCREEN 13
timein = TIMER
DO WHILE TIMER - timein < 1
delayLen = delayLen + 1 'or .5, or 3, or whatever works
LOOP

x = 1: y = 1
DO
LOCATE y, x: PRINT y
FOR delay = 1 TO delayLen: NEXT
LOCATE y, x: PRINT " "
x = x + 1
IF x = 40 THEN x = 1: y = y + 1
IF y > 22 THEN END
LOOP


 
 Respond to this message   
Responses

Create your own forum at Network54
 Copyright © 1999-2009 Network54. All rights reserved.   Terms of Use   Privacy Statement