Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errors and Debugging

0 views
Skip to first unread message

Ivan Dormain

unread,
Feb 7, 2001, 5:58:03 PM2/7/01
to
Could anyone assist me in being able to identify the line number within VB code
which produces an error.

I have seen before code which will enable you to record the total number of lines
within a project, and would like to extend my generic error handler to include
producing this line number.

Any assistance would be greatly appreciated.

Regards


Ivan

Craig Hunt

unread,
Feb 9, 2001, 1:16:19 PM2/9/01
to
Hi Ivan.

In order for you to take advantage of Erl (error line), you have to actually
define line numbers in your code.

<Cheesy Example>
Sub MySub()
On Error GoTo MySub_Err

1 Do something
2 Do Something Else
3 Do Something Else
4 Do Something Else

MySub_Err:
MsgBox "Oops! I got an error in procedure MySub! " & Error & " Line
Number: " & Erl

End Sub
</Cheesy Example>
--
HTH

Craig Hunt, MCSE, MCDBA
AISA Logic, Inc.
http://aisalogic.com

--Think when you breathe.

"Ivan Dormain" <iv...@bit.net.au> wrote in message
news:15f201c09159$6cfc6110$a5e62ecf@tkmsftngxa07...

Gary Gu

unread,
Feb 12, 2001, 11:08:46 PM2/12/01
to
Hi Ivan,

VB itself didn't provide such function. To implement this task, we should
process it by ourself as Craig siad.

Best Regards,

0 new messages