ErrorFile()

Syntax

Result$ = ErrorFile()
Description
Returns the filename of the source code or includefile where the current error occurred. This command only returns a meaningful value if there was an error handled by OnErrorCall() or OnErrorGoto().

The tracking of line numbers needs to be enabled on compilation for this command to return the actual file name. To enable this feature, enable the "Enable OnError lines support" checkbox in the compiler options or specify the /LINENUMBERING (Windows) or --linenumbering (Linux, Mac OSX) command-line switch when compiling from the command-line.

Parameters

None.

Return value

The filename of the error, or "OnError line support disabled" if the OnError lines support is disabled. (A simple way to check if the OnError lines support is enabled is to check if the result of ErrorLine() is not -1.)

Supported OS

All

<- ErrorCode() - OnError Index - ErrorLine() ->