<-- Previous || Up || Next -->

Find Error Function
Basic Extensions Class

Public Function FindError( _
    ByVal vPattern As Variant _
    ) As Variant

Returns a String containing the number and message of all errors where some part of the error message string matches vPattern.

Summary: This function returns each of the Visual Basic errors whose messages contain some string (like "bad" or "overflow") or matches some pattern (like "bad*" or "*opera[nt]*"). If vPattern is a phrase such as "bad" which does not contain any of the special characters recognized by the Visual Basic "Like" operator, then this function will search for that string anywhere within the error messages--it is the same as putting asterisks around it as in "*bad*". If vPattern is a pattern which DOES contain one of the special characters (?, *, #, [, or ]), then that pattern is not altered--the entire error message must match the pattern for the error message to be returned.
Examples:
    ? FindError("bad")
    49: Bad DLL calling convention
    52: Bad file name or number
    54: Bad file mode
    59: Bad record length
    63: Bad record number
    ? FindError("dll")
    47: Too many DLL application clients
    48: Error in loading DLL
    49: Bad DLL calling convention
    453: Specified DLL function not found
See also:
    Error$ Function (Visual Basic)
    Like Operator (Visual Basic)
vPattern: String containing the phrase or Visual Basic "Like" pattern that will be searched for within all Visual Basic error messages. Function returns Null if vPattern is Null or cannot be fixed up to a String.
Note: This function takes several seconds to cycle through all the possible errors looking for matches (it takes about 20 seconds on my 120 MHz '486).

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.