Get Error Code Line Method
The Get Error Code Line method returns a number that identifies the code line where an error occurred. If you use a Resume statement or an On Error statement after you use this method, then this method sets the return value to 0. To maintain the value of the line number, you must assign it to a variable. You can use the Error statement to set this return value.
Format
Erl
This method does not include arguments.
Example
The following example uses the Err statement to print the error number and the Erl statement to print the line number if an error occurs during an attempt to open a file. Siebel VB assigns line numbers, starting with 1. In this example the Sub Button_Click statement is line 1:
Sub Button_Click
Dim msgtext, userfile
On Error GoTo Debugger
msgtext = "Enter the filename to use:"
userfile = "c:\temp\trace.txt"
Open userfile For Input As #1
' ....etc....
Close #1
done:
Exit Sub
Debugger:
msgtext = "Error number " & Err & " occurred at line: " & Erl
Resume done
End Sub