?
Solved

Wait function in VB5

Posted on 1999-01-06
4
Medium Priority
?
447 Views
Last Modified: 2008-02-26
Is there a wait or sleep function in VB5 that I can use to release the cpu and suspend execution for a period of time?
0
Comment
Question by:gemme
[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
4 Comments
 
LVL 3

Expert Comment

by:jjbyers
ID: 1454389
I use the DoEvents and a do loop like this.

Dim EndTime As Date

  EndTime = Format(Now + #12:00:10 AM#, "long time")
  Do Until Format(Now, "long time") > EndTime
    DoEvents
  Loop

Hope this helps.
0
 

Accepted Solution

by:
jmnolan earned 400 total points
ID: 1454390
You can use this API call. It waits a specified number of milliseconds and then continues executing your program.

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

For a one second delay do this:

Sleep 1000

Hope that helps!
0
 

Author Comment

by:gemme
ID: 1454391
Thanks I will try this.
0
 
LVL 1

Expert Comment

by:bear454
ID: 1454392
DoEvents()
Check it out in vbhelp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

762 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