Pause the execution of a program?

HARRY

Active Member
Licensed User
Longtime User
Hi,

I need to postpone the further execution of an Basic4PPC program until another program has reached a certain stage.

One way to communicate between these programs is via the registry: the other programs writes a certain value to the registry and the first programs checks for it

I do not want to check this in a loop, as it would fully load the processor.

Is there a possibility to pause the execution of a program for some time, say 1second or to prevent the processor load in another way?

Or does another possibility exist for this inter program communication?

Harry
 

agraham

Expert
Licensed User
Longtime User
Or does another possibility exist for this inter program communication?
The program doing the work could create a file when it has finished and then exit. The waiting program could check for the existence of that file between "Sleep(x)"s and when it found it could delete it and carry on.
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Could you split your B4PPC code so that one sub runs up to the point at which it needs to wait for the other program to write to the registry/file.
The B4PPC program could then periodically check for the registry/file to update using a timed event, at which point it could call a sub to continue the rest of your program.

Regards,
RandomCoder
 
Top