?
Solved

Is there a Sleep type command?

Posted on 1998-11-23
4
Medium Priority
?
249 Views
Last Modified: 2010-05-03
Is a Sleep type command available to make the program wait for a certain amount of time?  I don't really want to use a timer control.  Or should I just create a loop to do the waiting
0
Comment
Question by:louy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:vikiing
ID: 1446309
There's no Delay nor Sleep command available to use (there are a lot of incredible things VB lacks). You can use a Time event, or a Do/Loop cycle with Timer control to "stop" program execution during a certain time:

Limit=Timer + 0.5
Do until Timer => Limit : Loop

That code cycles during half a second. Of course, the added value can be less than 0.5

0
 
LVL 2

Accepted Solution

by:
JiaH earned 200 total points
ID: 1446310
Yes. Use the sleep API as following:

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

0
 
LVL 3

Expert Comment

by:vikiing
ID: 1446311
Great !!!; I dídn't know that !!!!
0
 

Author Comment

by:louy
ID: 1446312
Thanks, sorry about the delay.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question