Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a pause command?

Status
Not open for further replies.

8Ball

Programmer
Jun 6, 2001
2
MT
Could you please tell ma the command to make a pause between two print command EG:
PRINT "HELLO"
PAUSE COMMAND
PRINT "HOW ARE YOU?"
THANK YOU
 
do you want a timed pause or a keyboard interrupted pause?
timed pause can use for/next loop
for x=1 to 10000:x1=x:next x this for example , jiggle values and do nothing portion to change the timing value. Also it is processor speed dependent.
for keyboard interrupt use the inkey$ and check for length of variable assigned to be greater than zero.
But assuming that you have the program running, somebody coming to the screen will find both lines presented. wouldn't you be better to ask a user name in your first line? Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
You could also use the SLEEP command...I know I know...It's cheezie but it'll get you out of the pan for the moment.

CLS
PRINT "HELLO"
SLEEP 1 'This sleeps for 1 second
PRINT "HOW ARE YOU?"
SLEEP 4 'This sleeps for 4 seconds--do ya get my drift?

of course the user can't enter without an input statement.

--MiggyD
"The world shrinks more and more with every new user online."
 
The TIMER function returns a value which changes precisely 1193181 times every 65536 seconds -- that is to say, roughly 18.2 times per second. You can use this to do sub-second delays:
[tt]
SUB delay(numTicks%)
FOR i% = 1 TO numTicks%
st# = TIMER
WHILE TIMER
= st#: WEND 'TIMER will change 1/18.2 of a second after the previous line
NEXT i%
END SUB
[/tt]

If you want better precision than this, you can modify the timer frequency with a couple of hardware I/O calls:
[tt]
SUB setTimerFrequency(ticksPerSec&)
IF (ticksPerSec& < 1) OR (ticksPerSec& > 1193181) THEN ERROR 5 'Illegal function call
clocksPerTick& = 1193181 \ ticksPerSec&
OUT &H43, &H34
OUT &H40, clocksPerTick& AND 255
OUT &H40, clocksPerTick& \ 256
END SUB

SUB resetTimerFrequency()
OUT &H43, &H34
OUT &H40, 0
OUT &H40, 0
END SUB
[/tt]

Be sure to call resetTimerFrequency before your program exits. This code will cause the system timer to run fast in some situations (dependant on operating system). However, the clock will be reset in these cases to an accurate value on the next reboot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top