Solved

Is there a Sleep type command?

Posted on 1998-11-23
4
246 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 65
maro to copy and paste from one worksheet to another based on a condition 11 70
MsgBox 4 75
why PtrSafe before Function on 64bit does not fix the APIs? 2 28
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

732 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