ERRORFILE (return error filename)

Top  Previous  Next

 

ERRORFILE( )

The ERRORFILE procedure returns the name of the file for which an error was posted. If the file is open, the full DOS file specification is returned. If the file is not open, the contents of the FILE statement's NAME attribute is returned. If the file is not open and the file has no NAME attribute, the label of the FILE statement is returned. If no error was posted, or the posted error did not involve a file, ERRORFILE returns an empty string.

Return Data Type:

STRING

Example:

ADD(Location)                          !Add new entry

IF ERRORCODE()

MESSAGE('Error with ' & ERRORFILE())  !Display error filename

END

 

See Also:

ERRORCODE

ERROR

FILEERRORCODE

FILEERROR

POPERRORS

PUSHERRORS

Trappable Run Time Errors