How Can We Return the Last Line Number Executed by A Program

How Can We Return the Last Line Number Executed by A Program

Anonymous
Not applicable
314 Views
5 Replies
Message 1 of 6

How Can We Return the Last Line Number Executed by A Program

Anonymous
Not applicable
I am trying to to write a debugger for a VB executable program that I am using to manipulate Autocad -- I have all the elements but while trying to put them together I realize that I am missing one important thing. And that is the ability to recover the last line executed by the executable code.

I know I read somewhere many years ago how it can be done from Access VBA so I am assuming therefore that it can also be done in VB as well.

Any suggestion you might have on this is welcome and
thanks for all the kind help you can extend.

Matt
0 Likes
315 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
No no no, sorry, correction, its not the last line executed by a code -- but its rather the current line number executed by a program at any given time that I am interested in having the ability to grab.

Gratefully,
Matt
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi Matt, It's early days yet, but I would not expect to find skills in writing debuggers away from the seriously high level programming community. You may care to search the web for newsgroups where readers are likely to have these skills. It would be worth joining the ADN if there are AutoCAD specific issues associated with the proposed operation of the debugger. -- Regards, Laurie Comerford www.cadapps.com.au "matt_1ca" wrote in message news:12558873.1109864550786.JavaMail.jive@jiveforum2.autodesk.com... > No no no, sorry, correction, its not the last line executed by a code -- > but its rather the current line number executed by a program at any given > time that I am interested in having the ability to grab. > > Gratefully, > Matt
0 Likes
Message 4 of 6

Anonymous
Not applicable
Hello Laurie,

Thank you for your reply.

I will keep all your suggestions in mind.

Gratefully,
Matt
0 Likes
Message 5 of 6

RonnieWilkins
Advocate
Advocate
Requirements:
1. You must specify line numbers for each line of code.
2. Use the 'Erl' function to return what line caused the error.

Public Sub ErrTest()
On Error GoTo Err_Handler

1 ThisDrawing.SelectionSets.Add ("Test")

2 ThisDrawing.SelectionSets.Add ("Test")


Err_Handler:
MsgBox "Error in ErrTest" & vbCr & _
"Description: " & Err.Description & vbCr & _
"Line number: " & Erl
End Sub
Ronnie Wilkins, Jr.
0 Likes
Message 6 of 6

Anonymous
Not applicable
I have mentioned this before but you can embed debug symbols in your executable and debug it from visual studio including break points, stepped execution, and variable insepection.
0 Likes