Hi.
I want to wait n seconds while running a loop.
Something like this -
startTime = Currenttime(); // this will set x to the current time
repeat
do some work here.....
diffTime = Currenttime() - StartTime;
until (diffTime = 5)
What is the easiest way to do it?
thanks
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Wait 5 secs in a loop
Started by
guyjoules
, Jan 17 2008 22:16
5 replies to this topic
Posted 17 January 2008 - 22:49
Thank you, but Delay(n) returns after n secs passes and I need to check something during that time.
Actually, I'm waiting for a custom process to finish, but if it hang, I want to abort after 5 or 10 secs. Delay() won't help me in this case.
Thanks
Actually, I'm waiting for a custom process to finish, but if it hang, I want to abort after 5 or 10 secs. Delay() won't help me in this case.
Thanks
Posted 22 January 2008 - 22:25
If you use LaunchApp() to start your process, Delay() to wait for completion, then check the LaunchApp return, does that not do what you want?
ie (assuming correct declarations)
returnValue = LaunchApp (myApp, myArgs );
Delay(5);
if returnValue < 0 then
// error handling/messaging here
endif;
Check the LaunchApp or LaunchAppAndWait documentation.
ie (assuming correct declarations)
returnValue = LaunchApp (myApp, myArgs );
Delay(5);
if returnValue < 0 then
// error handling/messaging here
endif;
Check the LaunchApp or LaunchAppAndWait documentation.
Edited by daengh, 22 January 2008 - 22:26.
Posted 23 January 2008 - 08:23
Thanks.
This could have been the solution but I can't tell if 5 secs is enough. It could be between 5-60 secs and I don't want the user to wait for nothing, because it can return in 2 secs as well.
Also, I would like to do something while I'm waiting...
Thanks!
This could have been the solution but I can't tell if 5 secs is enough. It could be between 5-60 secs and I don't want the user to wait for nothing, because it can return in 2 secs as well.
Also, I would like to do something while I'm waiting...
Thanks!
Posted 24 January 2008 - 11:36
You could look into the extended functionality of LaunchAppAndWait, see LAAW_PARAMETERS and LAAW_STARTUPINFO. If that doesn't do what you need call GEtSystemInfo with the TIME parameter to get the current time.
Stefan Krüger
InstallSite.org twitter facebook