faqts : Computers : Programming : Languages : Visual basic

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 26 people (88%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Is there a way of knowing exactly at what line an error occurred?

Jul 4th, 2001 02:05
Magnus Gudmundsson,


Yes, in vb1->6 there is. 
There is an undocumented function called erl
so say you have this code:
public function DummyFunctionThatDemonstratesErl
dim lSum as long 
on error goto Hell
1  'loads of code 
2 '
3 '
4 '
5 '
6 lsum = 100/0
7 ' even more code 
Exit function 
Hell
msgbox "Error occured at line: " & erl
End function 
'***********'
Notice that u have to markup each line with a number in order for Erl 
to work.
This can be particulary useful if U have an error that occurs at 
runtime on certain clients, then U can just make a debug version with 
marked lines, and get information about exactly where the error occurs.