Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about time
My question is this: what is the command to pause the computer's execution of a program for a certain number of cycles, if it exists? I want to create scrolling text, but this is the only roadblock. I don't want it to be in intervals of seconds, so using time$ will not work, as far as I know of. I read a little, and the TIMER function instead seems appropriate, but I am not sure yet. I am using QBasic 7.1 to program this, in case that is necessary at all.
there are a few solutions for this problem.
this one works slow on slow computers and fast on fast computers.

for a = 1 to number : next a

where number is a number. a big number will cause a big rest.

you can also use timer

t = timer
loop until timer > t + interval

where interval is the number of seconds? or milliseconds? to wait. this does not work if you run the program over midnight as timer returns the number of seconds\milliseconds? elapsed since midnight
WHILE RPG$ <> "complete" : make up silly excuses :WEND
you can also use this:


i got it from

it waits until the screen is refreshed and can be used in animation to reduce flickering.
WHILE RPG$ <> "complete" : make up silly excuses :WEND
this does timing of nineteenths of a second. i got it from the same site:

SUB DELAY (time%)
    DEF SEG = 0
    POKE (1132), 0
    IF PEEK(1132) < time% THEN GOTO CountDown
WHILE RPG$ <> "complete" : make up silly excuses :WEND
K. Thanks for that. The only time I required a delay was an analog clock (like a grandfather clock) program I was working on. I think I can work around the "number of seconds and midnight" thing. It is the easiest syntax, as far as I can tell.

Anyway, please consider this closed. If you have another method, feel free to post it. However, I have all the information I need, as far as I know of. Thank you LPG, and any additional posters. Decided to leave this completely.

Forum Jump:

Users browsing this thread: 1 Guest(s)