Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

Debug Print Redirect (Add-In)

$
0
0
This Add-In is designed specifically to work with my "Persistent Debug Print Window" found here. Other than academically looking at it, it's not much use without that other program.

Basically, this Add-In redirects all your Debug.Print statements to that PersistentDebugPrint.exe program. No need to rename your Debug.Print statements to do it. Here's a screenshot of the Add-In's only interface:

Name:  DebugRedirect.png
Views: 86
Size:  3.9 KB

As a note, you can use any/all the Debug.Print formatting, inclusive of Spc(), Tab(), semicolons (;), and commas (,). However, when redirected, the Add-In does not send out a Debug.Print line (to PersistentDebugPrint.exe) until the line is terminated. In other words, if you're in the habit of doing things like Debug.Print "asdfasdf"; then you won't see this line in PersistentDebugPrint.exe until a subsequent Debug.Print terminates the line. The Debug.Print line is stored in a buffer until terminated.

Also, to note, this doesn't interfere with any Debug.Assert statements, in case you happen to use those.

--------------------------

Compile the Add-In and save the DLL to wherever your Add-Ins are, and then load it (via your Add-Ins Manager). If you move the interface form, it'll return to where you positioned it the next time.

If you close that form, the whole Add-In is unloaded. Just re-load it to get the interface form back. It's your choice as to whether you keep it loaded.

Also, before someone requests it, I thought about a toolbar button, but I don't like the fact that the clipboard gets deleted/corrupted when you do that. I sometimes have stuff in my clipboard before I fire up the IDE. So, if you want this, you're on your own.

A HUGE thanks goes out to The Trick for several ideas and code snippets to get this done. Also, thanks go out to Eduardo and Dz32 for their assistance.

Update #1: Added two new checkboxes to the little interface form. They're pretty self-explanatory. Here's the new interface:

Name:  DebugRedirect2.png
Views: 55
Size:  5.2 KB

Here's what the new "Run Starting" note looks like in the PersistentDebugPrint.EXE program:

Quote:

**** IDE Running "Project1" @ Saturday 11:57:08 am ****
Enjoy,
Elroy
Attached Images
  
Attached Files

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>