ERFN
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgErfn
- Last revised: 2016-03-12
Error reporting function
Syntax
` declare function Erfn ( ) as zstring ptr
`
Usage
` result = Erfn ( )
`
Return Value
Returns a pointer to the string identifying the function where the error occurred.
Returns NULL if the source is not compiled with the -exx compiler option.
Description
An error reporting function returning a pointer to the name of the function.
Examples
start GeSHi
vb
'' test.bas
'' compile with fbc -exx -lang fblite test.bas
#lang "fblite"
Sub Generate_Error
On Error Goto Handler
Error 1000
Exit Sub
Handler:
Print "Error Function: "; *Erfn()
Print "Error Module : "; *Ermn()
Resume Next
End Sub
Generate_Errorend GeSHi
Output:
vb
Error Function: GENERATE_ERROR
Error Module : test.basDialect Differences
- Not available in the -lang qb dialect unless referenced with the alias
__Erfn.
Differences from QB
- New to FreeBASIC
See also
ErlErmnOn...Error
Back to DocToc