INCLERRORFILE$: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_INCLERRORFILE$}} The _INCLERRORFILE$ function returns the name of the original source code $INCLUDE module that caused the most recent error. {{PageSyntax}} : {{Parameter|errfile$}} = _INCLERRORFILE$ {{PageDescription}} If the last error occurred in the main module, _INCLERRORFILE$ returns an empty string. ==Availability== * '''Version 1.1 and up'''. {{PageExamples}} ''Example:'' {{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} DebugLi...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:_INCLERRORFILE$}}
{{DISPLAYTITLE:_INCLERRORFILE$}}
The [[_INCLERRORFILE$]] function returns the name of the original source code [[$INCLUDE]] module that caused the most recent error.
The [[_INCLERRORFILE$]] function returns the name of the original source code [[$INCLUDE]] module that caused the most recent error.




Line 12: Line 11:




==Availability==
{{PageAvailability}}
* '''Version 1.1 and up'''.
* '''Version 1.1 and up'''.


Line 33: Line 32:
     {{Cl|PRINT}} "    IN MODULE "; {{Cl|_INCLERRORFILE$}}; " (line"; {{Cl|_INCLERRORLINE}}; ")"
     {{Cl|PRINT}} "    IN MODULE "; {{Cl|_INCLERRORFILE$}}; " (line"; {{Cl|_INCLERRORLINE}}; ")"
{{Cl|END IF}}
{{Cl|END IF}}
{{Cl|RESUME}} {{Cl|NEXT}} '' ''
{{Cl|RESUME}} {{Cl|NEXT}}
{{CodeEnd}}
{{CodeEnd}}
{{OutputStart}}An error occurred. Please contact support with the following details:
{{OutputStart}}An error occurred. Please contact support with the following details:

Latest revision as of 00:41, 29 January 2023

The _INCLERRORFILE$ function returns the name of the original source code $INCLUDE module that caused the most recent error.


Syntax

errfile$ = _INCLERRORFILE$


Description

If the last error occurred in the main module, _INCLERRORFILE$ returns an empty string.


Availability

  • Version 1.1 and up.


Examples

Example:

ON ERROR GOTO DebugLine

ERROR 250 'simulated error code - an error in the main module leaves _INCLERRORLINE empty (= 0)

'$INCLUDE:'haserror.bi'

END

DebugLine:
PRINT "An error occurred. Please contact support with the following details:
PRINT "ERROR "; ERR; " ON LINE: "; _ERRORLINE
IF _INCLERRORLINE THEN
    PRINT "    IN MODULE "; _INCLERRORFILE$; " (line"; _INCLERRORLINE; ")"
END IF
RESUME NEXT
An error occurred. Please contact support with the following details:
ERROR  250  ON LINE:  6

An error occurred. Please contact support with the following details:
ERROR  250  ON LINE:  9
    IN MODULE haserror.bi ( line 1 )


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link