User Tom Ba ( posted:

ability of function to return
something like a success/fail status
is perfect for implmenting error-checking.

Why bother with subs?

Don't wook at the spam
or you will miss aww the heavenwy gwowwy
here at dwums of dundee
----Original Message Follows----
From: Jane McGloin <>
Reply-To: "SQA Suite Team Test Users" <>
To: "SQA Suite Team Test Users" <>
Subject: RE: Error handling
Date: Mon, 22 Oct 2001 12:19:02 +1000


1. I am attaching a file that we use as our template for scripts. Every
function (library and script) we write we have the return as a string.
This string can return "ERROR" or values that can be used. This string can =
then be checked to see if the function worked successfully or not and act
2. Within the function variables are set up to hold information that
gets logged about the error that occurred eg function name, error number,
error description, line number.

3. After the variables are dimmed the On Error GoTo label is placed.
When an error occurs the run of the code is diverted to the error handler
and the
information held in the variables mentioned in 2 are writted to what ever
log is being used.

Many of our subs have been turned into functions just for this
functionality. In this way we record errors when they occur and can deal
with them as we need to.

I hope this helps.

Regards Jane


Jane McGloin

Invetech Operations Pty Ltd
Private Bag 44
495 Blackburn Road
Mount Waverley Vic 3149

Phone: 61 3 9211 7700 (switchboard)
Direct: 61 3 9211 7899
Fax: 61 3 9211 7703 (facsimile)
Mobile: 61 0407 506 389
__________________________________________________ _________
IMPORTANT - This email and any attachments may be confidential. Any
retransmissions, dissemination or other use of these materials by persons or
entities other than the intended recipient is prohibited. If received in
error, please contact us and delete all copies. Before opening or using
attachments, check them for viruses and defects. Our liability is limited to
resupplying any affected attachments. [Any representations or opinions
expressed in this e.mail are those of the individual sender, and not
necessarily those of Vision Systems Limited].

<< ScriptTemplate.rec >>