Solved

Is there a Sleep type command?

Posted on 1998-11-23
4
239 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
  • 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 50 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now