Debug tool instead of info_box
by Allan Greis Eriksen
Debug_box can be used instead of the normal info_box for troubleshooting. It is more practical to use debug_box because it is easier to locate when removing your debugging code before compiling the application for use by the end user.
There is an extra button called "Kill" that can be used to terminate the application that is useful if you call the debug_box from inside a loop.
The debug_box will remember it's position every time you close the debug_box unless you use the Kill-button.
Furthermore it lists the length of the message string in bytes in the caption-bar of the debug_box which is useful when debugging a string that contains spaces.
Why you want an alternative to info_box
One other thing that actually started me making the debug_box is that it IS a part of VDF. This means that you have hotkeys assigned to other parts of your program, they will not be interferred with since the info_box is a call to the Windows API and will not know about these hotkeys.
Take for example the case that you have assigned ALT+F1 to a global procedure (or at least a procedure located in the desktop). This procedure might list information such as commenly used database files and display the actual record buffers for these files. So while the debug_box is shown, you could hit ALT+F1 to invoke this procedure.
The Debug_box will also save the original indicators FOUND, FINDERR and LASTERR before the debug_box is activated and restores these indicators again when the debug_box is closed.
The reason for this is to make sure that the debug_box does not interfere with the rest of your application.
The debug_box does understand the newline character "\n" just like the info_box does. But you could replace the "\" with another character of your choice in the package file. The reason for this would be that if you fire up debug_box with the message containing a file path, and that path has a directory beginning with the letter "n" right after the backslash, it will break the path in two and throw away the "n".
For example "C:\Temp\New\Something" will look like this:
The default has been left as "\n".
Use it like this:
Send Debug_box "Text"
NOTE! Do not try to call debug_box BEFORE start_UI has been executed, your application will freeze when closing the debug_box.