Hi,
I need to print the line number in VB in runtime. Is there any function/API
available to do this?
e.g.
Private Sub TestMethod()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = 10
b = 20
c = 40
MsgBox <<HERE I WANT TO PRINT THE LINE NUMBER>>
End Sub
Please help me in doing this.
Thanks,
Su Man
Jan Hyde - 21 Sep 2005 09:19 GMT
"Su Man" <subu501@yahoo.com>'s wild thoughts were released
on Wed, 21 Sep 2005 11:57:58 +0530 bearing the following
fruit:
>Hi,
>
[quoted text clipped - 17 lines]
>
>End Sub
It doesn't really make any sense since you would have to
assign the line number (ie hard code it) then in the
scenario you present there really is no difference in just
doing
Msgbox 123
If you want the line number where an error occured then
that's a different story.
Jan Hyde (VB MVP)

Signature
Who knocks on your door selling Halloween cookies?
Ghoul Scouts
(Ken Pinkham)
[Abolish the TV Licence - http://www.tvlicensing.biz/]
DRBarkley - 21 Sep 2005 11:18 GMT
> Hi,
>
[quoted text clipped - 22 lines]
> Thanks,
> Su Man
Su Man,
You would need to add line numbers to each line.
Then--as Jan mentioned--you could use ERL to get the line number on which
the error occurred.
HTH,
DRBarkley
Someone - 21 Sep 2005 14:59 GMT
See my post here:
http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/4c4d92
99aaea6607
> Hi,
>
[quoted text clipped - 23 lines]
> Thanks,
> Su Man