ERROR
ERROR AS Boolean
Returns
TRUE if an error has happened.
Use it just after a
TRY instruction to know if the executed instructions failed.
To get more information about the error, use the
Error class.
The Error flag is reset to
FALSE when:
-
The RETURN instruction is executed.
-
A TRY instruction has been executed without any error.
Note: Only
Error is set to false.
Error class properties like
Error.
Text will not be reset.
So never test any
Error.class properties to detect an error, just test Error itself.
Eg.
Examples
Dim FileName as string = "File"
TRY KILL FileName
IF ERROR THEN PRINT "Cannot remove file. "; Error.Text
ERROR ...
ERROR Expression [ { ; | ;; | , } Expression ... ] [ { ; | ;; | , } ]
Prints expressions to the standard error output, exactly like the
PRINT instruction.
The standard output can be redirected by the
ERROR TO statement.
See
PRINT for more details about the syntax and the behaviour.
See also