1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 10:30:36 +00:00
QB64-PE/internal/help/_INCLERRORLINE.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

58 lines
1.4 KiB
Plaintext

{{DISPLAYTITLE:_INCLERRORLINE}}
The [[_INCLERRORFILE$]] function returns the line number in an [[$INCLUDE]] file that caused the most recent error.
{{PageSyntax}}
: {{Parameter|errline&}} = [[_INCLERRORLINE]]
{{PageDescription}}
* If the last error occurred in the main module, _INCLERRORLINE returns 0.
* By checking _INCLERRORLINE you can report exactly what line inside an included module caused the last error.
==Availability==
* '''Version 1.1 and up'''.
{{PageExamples}}
''Example:''
{{CodeStart}}
{{Cl|ON ERROR}} {{Cl|GOTO}} DebugLine
{{Cl|ERROR}} 250 'simulated error code - an error in the main module leaves _INCLERRORLINE empty (= 0)
'{{Cl|$INCLUDE}}:'haserror.bi'
{{Cl|END}}
DebugLine:
{{Cl|PRINT}} "An error occurred. Please contact support with the following details:
{{Cl|PRINT}} "ERROR "; {{Cl|ERR}}; " ON LINE: "; {{Cl|_ERRORLINE}}
{{Cl|IF...THEN|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}}
{{Cl|PRINT}} " IN MODULE "; {{Cl|_INCLERRORFILE$}}; " (line"; {{Cl|_INCLERRORLINE}}; ")"
{{Cl|END IF}}
{{Cl|RESUME}} {{Cl|NEXT}} '' ''
{{CodeEnd}}
{{OutputStart}}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 )
{{OutputEnd}}
{{PageSeeAlso}}
* [[_INCLERRORFILE$]]
* [[ON ERROR]], [[ERR]]
* [[ERROR]]
* [[ERROR Codes]]
* [[$INCLUDE]]
{{PageNavigation}}
<