Solved

Program Hang

Posted on 1999-01-21
4
152 Views
Last Modified: 2010-05-03
how do i know that my program is Hang ? and can i write a code to detect and skip it ?
0
Comment
Question by:siang
[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:HATCHET
ID: 1469911
siang,

In the Functions and Subs you write, make sure to at least put "On Error Resume Next" if not a more extensive error trap to ensure you're program runs smoothly and bows out gracefully if it does crash or encounter an error.  Here is an example of what I mean:

_____________________________________________________________________

Private Sub Form_Load()
On Error Resume Next
 
  Dim MyVariable(10) as String

  MyVariable(11) = "Hello"

End Sub
_____________________________________________________________________

In this example, if you did not AT LEAST have the "On Error Resume Next", you'd get Run-Time Error #9 - "Subscript out of range".  This will make your programming a lot easier.

HATCHET
0
 

Author Comment

by:siang
ID: 1469912
sorry..what i meant is totally goes hang...the line of code cannt execute anymore
0
 
LVL 1

Expert Comment

by:rondeauj
ID: 1469913
That type of problem would be handled by the operating system
0
 
LVL 3

Accepted Solution

by:
HATCHET earned 30 total points
ID: 1469914
siang,

Go to the following URL and check out a program called "First Aid".  I've had it for several years and LOVE IT!  It will catch any crashes that happen and tell you what caused the crash, give you information on the stack dump and error source, then allow you to automatically fix the problem and resume where you left off.  It also has a utility that will scan your system for resource or hardware conflicts and fix them for you.

http://www.cybermedia.com/products/firstaid/


HATCHET
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

696 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