Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting VFP to
Message
From
08/08/2001 18:35:39
 
 
To
08/08/2001 18:28:28
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00541567
Message ID:
00541604
Views:
12
>>I know I've seen this before, but I can't remember the answer.
>>
>>How does one put a VFP application to sleep for some number of seconds? In 2.6 I would write a loop which did nothing
>>
>>
>>PROCEDURE sleep
>>PARAMETERS nWait
>>PRIVATE ALL
>>nSeconds = SECONDS()
>>nEnd = nSeconds + nWait
>>DO WHILE SECONDS() < nEnd
>>  ** Do Nothing
>>ENDDO
>>
>>
>>I'm pretty sure I've seen a reference to an API call which does the same thing. Could someone please post an example for me???
>>
>
>If you want to be able to wake up on demand:
>
>
>= INKEY([nSeconds])
>
One problem I have noticed with the Sleep() function in VFP is that
it appears to put all VFP applications on your machine to sleep at the same
time.

I noticed this when I wrote an application that sat in the notification area and
checked for a valid internet connection every 30 seconds, this app tried to connect to www.microsoft.com and if succesful changed the icon to a green one and if not it would go red. After checking it would call Sleep(30000). I noticed that when this program was running I could only type in the VFP IDE during the brief moment that the program was actually doing the checking.

Just my two cents.

Chris Ormerod
Have a nice day :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform