Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / September 2005



Tip: Looking for answers? Try searching our database.

Finding the line number at runtime

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Su Man - 21 Sep 2005 07:27 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.