If you are using the Debug version (that is, you generate a .pdb file) the
closest that I can think is:
Dim objStackFrame As StackFrame
Dim x As Integer
If x = 0 Then
objStackFrame = New StackFrame(True)
MessageBox.Show("You have executed line " &
(objStackFrame.GetFileLineNumber() - 1).ToString)
End If
And then you can display line numbers in the code using the Tools, Options
menu, Text Editor, Basic, General node, Display Line Numbers checkbox.
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"genojoe" <ge*****@discussions.microsoft.com> escribió en el mensaje
news:79**********************************@microsof t.com...
The following shows me the last line number executed. It requires an
error.
7811: Try
Err.Raise(60000)
Catch ex As Exception
MsgBox("Error 60000 at " & Err.Erl())
End Try
Is there a way to show a line number without creating an error. For
example, I am looking for a function that would return the following
message:
"You just executed a statement at line #7811"
7811: If X = 2 Then
MsgBox "You just executed a statement at #" & ????
End IF
I can't find this function or figure out how to write it. Is there a way
to
do this?