Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to use "wait" whitout stopping the whole program?

Author
Message
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 9th May 2003 00:01
How to use "wait" whitout stopping the whole program?
Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th May 2003 00:05
You don't - that's what wait does.

What are you trying to do?
Kentaree
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 9th May 2003 14:18
If you want just one process to stop, set up its own basic timer. For example

startTime=timer()
if (startTime-timer())>1000
`continue with process
endif

Putting this in your program will do something after 1sec, i.e 1000 milliseconds.

Whatever I did I didn't do it!
Cras
23
Years of Service
User Offline
Joined: 15th Oct 2002
Location: United Kingdom
Posted: 9th May 2003 14:23
dont you mean timer() - startTime ??? the way you have posted would go into negatibves and never reach 1000.
Trev C
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: United Kingdom
Posted: 9th May 2003 17:20
The wait command can already do that , just use:

wait 1000

Your prgram will then stop for 1000 milliseconds before continuing, and it is a lot easier to read

Trev C
Trev C
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: United Kingdom
Posted: 9th May 2003 17:22
Ooops, I re-read your request and see what you mean now, you just want one part of the program to hang, like bullet checking or something.

silly me x-d

Trev C
Kentaree
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 9th May 2003 17:55
Maniac, you're right. Stupid me hehee.

Whatever I did I didn't do it!
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 9th May 2003 23:10
i mean that my program is executing different things at the same time but for one i need to use the wait command but i dont want to let the other executions wait.
see my point?

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 9th May 2003 23:23
It 's not clear what you want to do:
stop a certain action for some time or to trigger the action only when you want to...
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 10th May 2003 00:24
Set a timer, a flag, or a trigger for whatever operation you don't want to continue.

--Mouse

Famous Fighting Furball
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 10th May 2003 02:34 Edited at: 10th May 2003 02:37
If I read that question right, you will need to use the



The rest of the program will run but the FunctionContinue will not execute until five seconds after the initialisation of nEvent.

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.

Login to post a reply

Server time is: 2026-07-11 13:57:57
Your offset time is: 2026-07-11 13:57:57