Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 21st, 2003, 11:49 AM
Fagoh13 Fagoh13 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 6 Fagoh13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Time out execution

Hello does anybody now how to pause the execution of a program until certain condition becomes true
i already tried with a cicly but the program form then doen't respond and i want to know what can i do

thanks

Reply With Quote
  #2  
Old July 21st, 2003, 05:09 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
the Sleep API function is your best bet as it pauses the execution within an event.

you can also do a busy wait which is not so hot, but if you don't have time to mess around and just want to get it out of the way. Here's the busy wait function to use if you're lazy

Add this code to a module:

Public Declare Function GetTickCount Lib "kernel32" () As Long

Public Function Pause(Value As Long) ‘ Value is the amount of time to pause
‘ for in milliseconds
Dim PreTick As Long

PreTick = GetTickCount

Do
DoEvents
If GetTickCount = PreTick + Value Then Exit Do
Loop

End Function

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Time out execution


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway