Solved

Sleep the Process

Posted on 2001-06-07
9
1,280 Views
Last Modified: 2007-11-27
How can i stop the process for some seconds in  VB6.0 ?  
0
Comment
Question by:vinaikk
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 6162920
Sleep(5000)

to sleep in 5 secs..

/Joachim
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6162937
use the sleep api, call it like this...

call sleep(5000) '1000 = 1 second
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6162941
Hi, to use Sleep(n) , n = miliseconds. You need to add this API first:

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

Sleep 3000 ' = 3 seconds

OR

You can create a For Loop like this:

dim n as long
For i = 1 to n
     Doevents 'Let Windows handles other processes.
Next i


'Hope will help.
0
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!

 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 5 total points
ID: 6162943
LOL, when i read the question there was no comments, i went to the bathroom came back and commented and your comment was there...


0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6162947
Correct my codes:

dim n as long

n = 30000

For i = 1 to n
    Doevents 'Let Windows handles other processes.
Next i


0
 

Author Comment

by:vinaikk
ID: 6163238
This is too good thanks a ton !!!
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163381
Get out of here. Give the points to the right answer.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6163865
joahimc, I did not ask for the points...sorry about that...the reason i left that comment saying that i dident know your post was there i when i posted is because i loaded it and then when to the bathroom came back and posted as you can see my post is 2 min after yours...I dont want the points for it but i dont think there is anyway he can take them back and give them to you...but i do agree you deserve them...

Brian
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163877
Not your fault he should know who to choose by himself shouldn't he :)
0

Featured Post

Industry Leaders: 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

717 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