Error Statement

   
Error Statement

Syntax

 Error [   errornumber   ] 
errornumber (optional; Long)

Any valid error code

Description

Raises an error

Rules at a glance

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.

Programming Tips and Gotchas

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.

See Also

Err.Raise Method, Try...Catch...Finally Statement

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net