Printed trail of each statement a vb6 program goes through.-VBForums
Results 1 to 28 of 28

Thread: Printed trail of each statement a vb6 program goes through.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    23

    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.

  2. #2
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    23

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Spooman View Post
    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.

  4. #4
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    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 !!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    23

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Spooman View Post
    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?

  6. #6
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    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

  7. #7
    PowerPoster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,002

    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
    In order to understand recursion, one must first understand recursion….

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,277

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    PowerPoster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,002

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by techgnome View Post
    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 01:44 PM.
    In order to understand recursion, one must first understand recursion….

  10. #10

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    23

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by techgnome View Post
    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.

  11. #11
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    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

  12. #12
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,277

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by TysonLPrice View Post
    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  13. #13
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    629

    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.
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

  14. #14
    PowerPoster
    Join Date
    Oct 2013
    Posts
    2,917

    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

  15. #15
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    629

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Arnoutdv View Post
    CodeSmart seems to capable of doing this:

    http://www.axtools.com/products-codesmart-vb6.php#T2
    He wants to see each line that is executed while the code is running.
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

  16. #16
    PowerPoster
    Join Date
    Oct 2013
    Posts
    2,917

    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.

  17. #17
    PowerPoster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,002

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Eduardo- View Post
    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.
    In order to understand recursion, one must first understand recursion….

  18. #18
    PowerPoster
    Join Date
    Oct 2013
    Posts
    2,917

    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 07:44 AM.

  19. #19
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    629

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Arnoutdv View Post
    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 05:57 AM.
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

  20. #20
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    629

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by TysonLPrice View Post
    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.
    Quote Originally Posted by wwwursa View Post
    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.
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

  21. #21
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Arnoutdv View Post
    CodeSmart seems to capable of doing this:

    http://www.axtools.com/products-codesmart-vb6.php#T2
    WOW. Looks promising ..

    Eduardo

    FWIW, someone suggested the F8 key in post #11 ..

    Spoo

  22. #22
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    629

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Spooman View Post
    WOW. Looks promising ..

    Eduardo

    FWIW, someone suggested the F8 key in post #11 ..

    Spoo
    Ah, OK, I didn't see it.
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

  23. #23
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    Re: Printed trail of each statement a vb6 program goes through.

    Quote Originally Posted by Eduardo- View Post
    Ah, OK, I didn't see it.
    No probs.
    Besides, your post #13 was better stated than mine was.

    Spoo

  24. #24
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,026

    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

  25. #25
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    869

    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

  26. #26
    Addicted Member Davor Geci's Avatar
    Join Date
    Sep 2009
    Posts
    141

    Re: Printed trail of each statement a vb6 program goes through.

    If you guys are talking on Logging custom events to let's say Azure cloud I would suggest my newest project VBATelemetry.com it also works with vb6 and the logging to the cloud is asynchronously. So no waiting to function to complete the logging task.
    Video:

    https://youtu.be/AEJrrtZOGYw?t=11m43s

    Or a article:
    https://www.vbatelemetry.com/full-gu...cel-workbooks/


    There is no difference between vba and vb6 code.
    Davor Geci
    CEO @ WinPIS
    My projects:
    VBA Telemetry (connect VBA & VB6 with Microsoft Azure - Application Insights)
    Virtual Forms project (create database apps in minutes with vb6)

  27. #27
    Addicted Member
    Join Date
    Jun 2015
    Posts
    140

    Re: Printed trail of each statement a vb6 program goes through.

    numega smartcheck used to be able to do this with compiled apps.

    It was a great piece of software, hooked all the vb6 runtime exports and captured args,
    long defunct and probably really hard to find though.

    that said your better off with targeted debugging and debug.print statements.
    I will take interactive debugging over super long runlog review anyday.

  28. #28
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    569

    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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.