• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Program Hang

how do i know that my program is Hang ? and can i write a code to detect and skip it ?
0
siang
Asked:
siang
  • 2
1 Solution
 
HATCHETCommented:
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
 
siangAuthor Commented:
sorry..what i meant is totally goes hang...the line of code cannt execute anymore
0
 
rondeaujCommented:
That type of problem would be handled by the operating system
0
 
HATCHETCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now