dcsimg
Results 1 to 2 of 2

Thread: Persistent Debug Print Window

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,708

    Persistent Debug Print Window

    Ok, there's a fairly good Windows "built-in" option for this, discussed here.

    However, I wanted a more pure VB6 solution. So, I came up with the following. Basically, it just gives you a DebugPrint procedure in any program you're developing, with the output being persistent across exits and re-loads of the VB6 IDE. Also, if you're developing something that's crashing your IDE, it will be persistent for that as well. Also, it can show you substantially more volume of information than the IDE's Immediate window. Also, it will work from a compiled program as well as from the IDE.

    It preserves the ability to use the comma (but not the semicolon) when printing debug information. For instance, the following are valid:

    DebugPrint "Test Point #1"
    DebugPrint "Var1:", Var1, "Var2:", Var2

    But this won't work:

    DebugPrint "Var1: "; Var1

    With respect to the actual PersistentDebugPrint program, you can either compile it and execute it, or you can just execute it from the IDE. It'll work either way.

    To use it, you just throw the DebugPrint.bas module into the program you're developing, and start making calls to the DebugPrint procedure. I've included a program named Test so you can see how it works. Just run Test and click on the form to see how it works (with the PersistentDebugPrint program running when you do).

    Warning: In the PersistentDebugPrint program, I store a handful of settings in the registry. If you look, it's obvious what I'm storing, but I know that this concerns some people, so this is just a heads-up that I'm doing this.

    Basically, here's all it is (from the Test program):

    Name:  DebugPrint.png
Views: 224
Size:  8.7 KB

    Enjoy,
    Elroy

    Update #1: The class name for the DebugPrint window is a bit different when compiled versus running in the IDE, and I forgot to check for that. That's now fixed. I also added a DoDebugPrint constant to the DebugPrint.bas module so you can turn it all on/off without needing to comment out your DebugPrint lines.
    Attached Files Attached Files
    Last edited by Elroy; Apr 28th, 2019 at 03:24 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #2
    Lively Member
    Join Date
    Jun 2016
    Posts
    86

    Re: Persistent Debug Print Window

    very good work, as additional data only works if the program works as an administrator.

    I could also put the path or name of the executable that sent the message in case there is more to differentiate

    a greeting

    sorry for using translator

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