1. [DOS] How to code for a time delay?

Suppose I wanted to display a row of stars on the screen in sequence, each
appearing (let's say) 1 second after the previous star, eg:
"*" <wait 1 sec> "*" <wait 1 sec> "*" <wait 1 sec> "*" ...

Is there a routine that will do this - eg time()? tick_rate()?

Any hints appreciated!

Alex Caracatsanis

new topic     » topic index » view message » categorize

2. Re: [DOS] How to code for a time delay?

Alex Caracatsanis wrote:
> 
> Suppose I wanted to display a row of stars on the screen in sequence, each
> appearing (let's say) 1 second after the previous star, eg:
> "*" <wait 1 sec> "*" <wait 1 sec> "*" <wait 1 sec> "*" ...
> 
> Is there a routine that will do this - eg time()? tick_rate()?
> 
> Any hints appreciated!
> 
> Alex Caracatsanis

Alex:

while 1 do
  sleep(1) -- sleep 1 second
if get_key() = 113 then -- "q" to quit. use key.bat to find out the code for
  the key.
    exit
  else
    puts(1,".")
  end if   
end if
end while


Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

3. Re: [DOS] How to code for a time delay?

Alex:



Whoops ! hit the enter too fast .
while 1 do
  sleep(1) -- sleep 1 second
if get_key() = 113 then -- "q" to quit. use key.bat to find out the code for
  the key.
    exit
  else
    puts(1,".")
  end if   
end while



Bernie
Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

4. Re: [DOS] How to code for a time delay?

Bernie Ryan wrote:
>   if get_key() = 113 then -- "q" to quit. use key.bat to find out the code for
>   the key.

A better way to write this is if find(get_key(),"qQ") then. BTW, 113='q'.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu