Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Pause the execution of a program?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-19-2007, 10:29 AM
Knows the basics
 
Join Date: Apr 2007
Location: Netherlands
Posts: 86
Default Pause the execution of a program?

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
Reply With Quote
  #2 (permalink)  
Old 12-19-2007, 11:05 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,817
Default

You could use Sleep(1000) to pause the execution for one second.
Reply With Quote
  #3 (permalink)  
Old 12-19-2007, 11:45 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by HARRY View Post
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.
Reply With Quote
  #4 (permalink)  
Old 12-19-2007, 02:57 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 448
Default

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
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop Execution of source on PDA badkarma Basic4ppc Wishlist 4 04-28-2008 03:00 AM
Is program XYZ running? HARRY Questions & Help Needed 10 01-12-2008 05:06 PM
V6-not-optim, V6-Debug, and V6-optimised give not the same nested FOR-NEXT execution dan kabestan Questions & Help Needed 1 01-04-2008 07:17 PM
Program load stevefan Questions & Help Needed 1 12-07-2007 06:24 AM
How to get a picture of the program? Stellaferox Questions & Help Needed 11 05-13-2007 08:33 PM


All times are GMT. The time now is 12:42 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0