OutputDebugString is a simple Windows-API function (takes only a string as parameter) and that's all. There is no need to buffer anything. ... If no such program is running, no one will ever see the messages. Otherwise you see the live output just like printing to a console window.
That helps a lot. Thanks for explaining it.
No need for debug-MsgBoxes anymore!
I'm warming up to the idea
...not many people besides programmers know about debugging etc. So my suggestion would be - a command similar to ListVariables, but - it should let user specify some text to output, and the output would be shown on one of the windows accessible from "View" menu of AHK.
That would take up memory, so I guess it could be limited to a 32 KB buffer containing only the most recent messages.
if you implement my WinAPI command, this would automatically be implemented too.
I want to add DllCall sometime but I've looked into it and it's not exactly simple. Here is an article that explains one approach: http://www.developer...icle.php/636741
I recommend both, the OutputDebugString command & the AHK DebugView. Perhaps a separate .exe that hooks into all existing & newly run AHK processes & adds that menu item, so each script isn't operating as it's own DebugView. One .exe would catch the debug messages & send it to any AHK windows that request it & thus be off while the other .exe isn't running. My 1st idea was for the new .exe to add the menu item, but it could exist & start the program if it's not running, any AHK could start it, but it would only run once & work for all AHK's. Perhaps while running tho, it would add a menu item "Close Debugger" to stop that process.
Those are great ideas but I think they're getting too elaborate for the expected number of people who would actually use such a feature.
How about a quick and dirty solution such as:
FileAppend, Some debug text.`n, **Debug ; Calls OutputDebugString().