-
Sep 21st, 2017, 09:36 AM
#1
Thread Starter
Junior Member
Printed trail of each statement a vb6 program goes through.
i HAVE A VERY COMPLEX VB6 PROGRAM.
i am looking for a program which will print out a list of the statements a program goes through when I press a certain command button.
THANK YOU.
-
Sep 21st, 2017, 10:46 AM
#2
Re: Printed trail of each statement a vb6 program goes through.
www
In the old days, Ashton Tate's dBASE IV referred to that as a "trace" and you could obtain exactly what you describe.
Off-hand, dunno how to do that in VB6 ..
Spoo
-
Sep 21st, 2017, 10:54 AM
#3
Thread Starter
Junior Member
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Spooman
www
In the old days, Ashton Tate's dBASE IV referred to that as a "trace" and you could obtain exactly what you describe.
Off-hand, dunno how to do that in VB6 ..
Spoo
I am hoping there is a add on program that does this.
-
Sep 21st, 2017, 11:17 AM
#4
Re: Printed trail of each statement a vb6 program goes through.
Dang .. I just checked Wiki, and dBASE is still around !!
dBASE 11 released 8 months ago !!
-
Sep 21st, 2017, 11:47 AM
#5
Thread Starter
Junior Member
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Spooman
Dang .. I just checked Wiki, and dBASE is still around !!
dBASE 11 released 8 months ago !!
Is there a way I can use dbase to "trace" a vb6 program?
Not familiar with dBase.
Anyone else has any suggestions?
-
Sep 21st, 2017, 11:53 AM
#6
Re: Printed trail of each statement a vb6 program goes through.
www
dBASE is a database and programming app. The programming syntax is much akin to VB6.
But, no, I doubt that dBASE could "trace" a VB6 program.
Of course, you could always re-write you entire app in dBASE (just kidding).
Spoo
-
Sep 21st, 2017, 12:14 PM
#7
Re: Printed trail of each statement a vb6 program goes through.
That reminds me of the old COBOL programming days of green bar paper source listings. When you wanted to work a program you went to the "documentation room". Checked out the program and you could read it to your hearts content. Geez...I'm glad those days are gone
Please remember next time...elections matter!
-
Sep 21st, 2017, 12:31 PM
#8
Re: Printed trail of each statement a vb6 program goes through.
As long as we're kicking around useless suggestion, in BASIC you could use TRON to run traces through a program. Don't think VB has that.
Incidentally, I cut my teeth on dBase II ... that was the first database system I ever worked with. Learned a little bit about tables and queries.
OK, so now that we're done kicking around useless suggestions that aren't going to help the OP, how about a few that will help?
Unfortunately I don't think there's a magic button or option you can turn on/off that will trace a program's code for you. Often what most of us have to resort to is rolling out some sort of logging library, and use that at the top of each sub/method/function to write out where we're at, and what certain values are... then afterwards, inspect the log to see what the path was. Within the IDE, you could probably use Debug.Writeline ... I think that works in VB6, I'm not sure.
If you can get a hold of the VB6 version of MZTools, I think it's got some addins that will add line numbers and some rudimentry logging to your code.. it may not be perfect, but it might help get things rolling.
-tg
-
Sep 21st, 2017, 12:39 PM
#9
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by techgnome
As long as we're kicking around useless suggestion, in BASIC you could use TRON to run traces through a program. Don't think VB has that.
Incidentally, I cut my teeth on dBase II ... that was the first database system I ever worked with. Learned a little bit about tables and queries.
OK, so now that we're done kicking around useless suggestions that aren't going to help the OP, how about a few that will help?
Unfortunately I don't think there's a magic button or option you can turn on/off that will trace a program's code for you. Often what most of us have to resort to is rolling out some sort of logging library, and use that at the top of each sub/method/function to write out where we're at, and what certain values are... then afterwards, inspect the log to see what the path was. Within the IDE, you could probably use Debug.Writeline ... I think that works in VB6, I'm not sure.
If you can get a hold of the VB6 version of MZTools, I think it's got some addins that will add line numbers and some rudimentry logging to your code.. it may not be perfect, but it might help get things rolling.
-tg
I took it the OP wanted individual lines of code in the order they get executed from one routine to another. Almost like a very ,very detailed stack trace.
Last edited by TysonLPrice; Sep 21st, 2017 at 12:44 PM.
Please remember next time...elections matter!
-
Sep 21st, 2017, 12:54 PM
#10
Thread Starter
Junior Member
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by techgnome
As long as we're kicking around useless suggestion, in BASIC you could use TRON to run traces through a program. Don't think VB has that.
Incidentally, I cut my teeth on dBase II ... that was the first database system I ever worked with. Learned a little bit about tables and queries.
OK, so now that we're done kicking around useless suggestions that aren't going to help the OP, how about a few that will help?
Unfortunately I don't think there's a magic button or option you can turn on/off that will trace a program's code for you. Often what most of us have to resort to is rolling out some sort of logging library, and use that at the top of each sub/method/function to write out where we're at, and what certain values are... then afterwards, inspect the log to see what the path was. Within the IDE, you could probably use Debug.Writeline ... I think that works in VB6, I'm not sure.
If you can get a hold of the VB6 version of MZTools, I think it's got some addins that will add line numbers and some rudimentry logging to your code.. it may not be perfect, but it might help get things rolling.
-tg
I have mztools and it is worth the $63.00 for just 1 or 2 of it many many features.
I sent an email to the author and awaiting a reply.
I am in shock that such a useful feature is not available on some add on.
It just may be that is is impossible to do within the confines of vb6.
Hopefully someone will have an answer for me.
-
Sep 21st, 2017, 02:02 PM
#11
Re: Printed trail of each statement a vb6 program goes through.
www
Do you need an actual printout?
How many lines of code do you expect to be involved?
If it is more a matter of debugging, would it be sufficient to just put a break-point at the beginning of the command button sub and just repeatedly press F8 to visually follow the code?
Spoo
-
Sep 21st, 2017, 02:08 PM
#12
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by TysonLPrice
I took it the OP wanted individual lines of code in the order they get executed from one routine to another. Almost like a very ,very detailed stack trace.
oooooh.... yeah, I don't think anything will do that... the closest you're going to get is something that spits out "I'm here!" ... "Now I'm here!" ... can't begin to count the number of times I've riddled my code with Foo's and Bar's.
in an attempt to figure out where the fork something was going wroing.
-tg
-
Sep 22nd, 2017, 12:27 AM
#13
Re: Printed trail of each statement a vb6 program goes through.
The closest you can have in VB6 is this:
Hit the F8 key and keep it pressed down.
You'll have the lines executed one by one and highlighted with yellow background the one that is executing.
When you get tired (or you already discovered the bug) press F5.
-
Sep 22nd, 2017, 02:30 AM
#14
Re: Printed trail of each statement a vb6 program goes through.
CodeSmart seems to capable of doing this:
3.2. Code Flow Explorer and Designer Explorer
If the expanded Code Flow folder area inside the Project Explorer is not enough then you can always use the dedicated Code Flow Explorer, plus the information is much more complete here. By using the 'Code Flow - Options' dialog, you can configure which code constructs you are interested in seeing in the tree.
http://www.axtools.com/products-codesmart-vb6.php#T2
-
Sep 22nd, 2017, 02:55 AM
#15
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Arnoutdv
He wants to see each line that is executed while the code is running.
-
Sep 22nd, 2017, 03:21 AM
#16
Re: Printed trail of each statement a vb6 program goes through.
I interpreted it as seeing the code flow starting from a certain piece of code.
-
Sep 22nd, 2017, 04:22 AM
#17
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Eduardo-
He wants to see each line that is executed while the code is running.
I thought he wanted some kind of document.
print out a list of the statements a program goes through when I press a certain command button.
Please remember next time...elections matter!
-
Sep 22nd, 2017, 04:42 AM
#18
Re: Printed trail of each statement a vb6 program goes through.
Same thoughts here, but you worded it better
Last edited by Arnoutdv; Sep 22nd, 2017 at 06:44 AM.
-
Sep 22nd, 2017, 04:52 AM
#19
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Arnoutdv
I interpreted it as seeing the code flow starting from a certain piece of code.
For that he has F9. (sets a breakpoint on that line)
Last edited by Eduardo-; Sep 22nd, 2017 at 04:57 AM.
-
Sep 22nd, 2017, 04:56 AM
#20
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by TysonLPrice
I thought he wanted some kind of document.
print out a list of the statements a program goes through when I press a certain command button.
Originally Posted by wwwursa
i HAVE A VERY COMPLEX VB6 PROGRAM.
i am looking for a program which will print out a list of the statements a program goes through when I press a certain command button.
THANK YOU.
I suppose he wants to debug something.
-
Sep 22nd, 2017, 07:30 AM
#21
Re: Printed trail of each statement a vb6 program goes through.
-
Sep 22nd, 2017, 04:43 PM
#22
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Spooman
WOW. Looks promising ..
Eduardo
FWIW, someone suggested the F8 key in post #11 ..
Spoo
Ah, OK, I didn't see it.
-
Sep 22nd, 2017, 04:52 PM
#23
Re: Printed trail of each statement a vb6 program goes through.
Originally Posted by Eduardo-
Ah, OK, I didn't see it.
No probs.
Besides, your post #13 was better stated than mine was.
Spoo
-
Sep 23rd, 2017, 08:53 AM
#24
Re: Printed trail of each statement a vb6 program goes through.
despite all the guesses as to what the op wants, i do not see any suggestion, if this should just be for the ide or if it should log when compiled, or both
i do not see that what is wanted should be impossible, but i would think it could slowdown program execution, and write large log files, so should be able to be enabled or disabled from within the program and /or command line parameter
in a large project, the # of code lines in the project may also become a problem
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 23rd, 2017, 09:16 AM
#25
Re: Printed trail of each statement a vb6 program goes through.
Pete
Program slowdown, I'd guess, is not an issue, as this would essentially be a 1-time debugging effort.
Unless you are referring to the # of code lines needed that would still affect performance if disabled.
BTAIM, what would you suggest would be said lines of code that could produce the log?
Spoo
-
Oct 3rd, 2017, 06:53 PM
#26
Re: Printed trail of each statement a vb6 program goes through.
Last edited by dz32; Apr 26th, 2019 at 11:29 AM.
-
Oct 4th, 2017, 03:27 PM
#27
Fanatic Member
Re: Printed trail of each statement a vb6 program goes through.
Finnish company Aivosto (means brains in english) has Project analyzer and VB Watch products.
http://www.aivosto.com/vbwatch.html
I'm not affiliated to that company.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|