August 2001
Intermediate to advanced
656 pages
18h 5m
English
Error Statement
Error [errornumber]errornumber
Use: Optional
Data Type: Long
Any valid error code
Raises an error
The Error statement is included only for backward
compatibility; instead, if you’re using standard Visual Basic
error handling, you should use the Err.Raise method and the
Err object. Otherwise, you should use structured
exception handling with the Try...Catch construct.
The Error statement has been a
“compatibility” statement for several versions of Visual
Basic. Interestingly, it managed to survive the general purge of
outdated language elements. Despite its persistence, we still
recommend that its use be strictly avoided.
Read now
Unlock full access