Error Function [Runtime] /text/sbasic/shared/03050300.xhp Sun Microsystems, Inc. converted from old format - fpe
Error function Error Function [Runtime] Returns the error message that corresponds to a given error code.
Syntax: Error (Expression) Return value: String Parameters: Expression: Any numeric expression that contains the error code of the error message that you want to return. If no parameters are passed, the Error function returns the error message of the most recent error that occurred during program execution. Example: sub ExampleError on error goto ErrorHandler REM Set up error handler Dim iVar as Integer Dim sVar As String REM An error occurs due to non-existent file iVar = Freefile Open "\file9879.txt" for Input as #iVar Line Input #iVar, sVar Close #iVar exit sub ErrorHandler: MsgBox "Error " & err & ": " & error$ + chr(13) + "In line : " + Erl + chr(13) + Now , 16 ,"error occurred" end sub