Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) 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
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
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: 15,732
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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 Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 623
Awards Showcase
Beta Tester 
Total Awards: 1
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
__________________
"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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to lock a program ? gjoisa Questions (Windows Mobile) 6 12-11-2008 08:19 PM
Program not run under CF3.5 ? Paulsche Questions (Windows Mobile) 7 10-15-2008 03:23 PM
V6-not-optim, V6-Debug, and V6-optimised give not the same nested FOR-NEXT execution dan kabestan Questions (Windows Mobile) 1 01-04-2008 07:17 PM
How to get a picture of the program? Stellaferox Questions (Windows Mobile) 11 05-13-2007 08:33 PM


All times are GMT. The time now is 06:14 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0