Erl Property

   
Erl Property

Class

Microsoft.VisualBasic.Information

Syntax

 Erl 

Return Value

An Integer containing the line number

Description

Indicates the line number on which an error occurred

Rules at a Glance

  • Erl returns the line number only if one has been provided in the source code.

  • If the error occurs on a line that does not have a line number, Erl returns 0.

Programming Tips and Gotchas

  • Erl is not affected by compiler settings. Compiling with the /debug- switch does not prevent Erl from accurately reporting the line number.

  • Line numbers are rarely used in modern VB code. In VB.NET, line numbers are labels that must be followed by a colon .

  • Although programmers have been requesting an error-handling function that reports the line number on which an error occurred, Erl has one major limitation: namely, it requires that the developer assign a line number to source code lines in advance.

  • Erl is not new to VB.NET. It was an undocumented and little known function in previous versions of Visual Basic (and of QBasic as well).

VB.NET/VB 6 Differences

In VB 6, line numbers are distinct from labels, and do not require that any symbol (other than white space) separate them from their lines' source code. In VB.NET, line numbers are labels that must be followed by a colon.

   


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