Errors Class

Description

The Errors class defines collection objects that contain Error objects. This class is usually used to define a property of another object, for the purpose of returning errors that occurred during execution of a method. An example of the use of this class is the Errors property of the fwCompile object.

Properties

Count Contains the number of Error objects held by the collection.

Methods

Item(nIndex) Returns the Error object that corresponds to the nIndex argument. The collection is 1-based, meaning that Errors.Item(1) will return the first error in the list.

Error Class

Description

The Error class can be used to defines objects, containing error message information. These objects are usually contained in an object of class Errors.

Properties

Message Contains a textual description of the error. This property is read-only.
Number Contains the error number. This property is read-only.
Severity Contains a number, corresponding to the severity of the error. This property is read-only. Defined values are:
0: Info
1: Warning
2: Error
Source Contains a character string that describes the source script, method, or procedure in which the error occurred. This property is read-only.

Example

The following example illustrates the use of the Errors property of the fwCompile object:

<%
fwCompile.CompileBatch('c:\scripts\*.*')
IF fwCompile.Errors.Count > 0
    * Read each message in the Errors object
    FOR M.i = 1 TO fwCompile.Errors.Count
        * Retrieve and display the current error
        %>

        Message: <%=fwCompile.Errors.Item(M.i).Description%><br>
        Number: <%=fwCompile.Errors.Item(M.i).Number%><br>
        Severity: <%=fwCompile.Errors.Item(M.i).Severity%><br>
        Source: <%=fwCompile.Errors.Item(M.i).Source%><br>
        <%
    NEXT
ENDIF
%>

© Aegis Group