pausing the program.

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
Is there a way to pause the program and then make it continue say a few seconds later?  For example I want to display an image, then I want to hide it after a number of seconds and continue with the rest of the code.  I understand this is possible using a timer.  Is there any other way in doing this without using a timer?

Question by:n-generation
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
  • 2
LVL 53

Accepted Solution

Ryan Chong earned 204 total points
ID: 8217152
Donno if Sleep API is suit in this condition:

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

Use like:

'Executing code here....

'Pause for 10 seconds

Sleep 10000

'Continue Executing code here....

Author Comment

ID: 8217241
Yea this will do just fine, but can you explain it to me.  What is Kernel32?  Is it just a built in function?
LVL 53

Expert Comment

by:Ryan Chong
ID: 8217299
Basically, we can use API (Application Programming Interface) to do pause program. Kernel32.dll is the core library that every windows platforms have to doing the regular tasks/jobs for windows operation.

And the function Sleep in Kernel32 is one of the function available in Windows, so that means actually we use external function from VB to do 'what VB cant do'.

Hope this is clear

Author Comment

ID: 8217462
Thank you so much! Really good explaination.  And learnt something new today =)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
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

771 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