Page 1 of 1
Posted: Tue Jul 30, 2002 3:21 am
by BackupUser
Restored from previous forum. Originally posted by pusztry.
Is there a good way to debug procedures? I can't get the variabls to come up that are in the degugger. I even tried to get the values in the debug window.
Thanks
Ryan
WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
Posted: Tue Jul 30, 2002 4:20 am
by BackupUser
Restored from previous forum. Originally posted by Franco.
Is there a good way to debug procedures? I can't get the variabls to come up that are in the degugger. I even tried to get the values in the debug window.
If I recall it right, you have to set the variables in procedures to global (set it as global outside the procedure) only then they are visible in the variable window.
Another way would be to use the command:
Debug MyVariable
inside your procedure.
Hope this helps a bit...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Posted: Tue Jul 30, 2002 7:38 am
by BackupUser
Restored from previous forum. Originally posted by fweil.
Hello,
Both are right Franco. You can make variables global or use Debug to have local variables state in the Debug output.
But there is also an alternate way I use from time to time, which is to design my own output for debgging variables (using the console most of the time because it is easy to use and format and it is separated from windows).
I do not think changing the debug behaviour would be easy, and I do not ask for any changes about local variables (what to do with included source code procedures, external procedures variables etc).
I mean that for larger applications, it is better for the coder to have his/her own debugging stuff integrated in the source code until the code turn clean enough.
Also the Debug output is unformatted, you can only have one variable state per line, or eventually concatenate several variables in a string, and the variable Debug ouput window gives variables listing with last state only but with refresh time, you may not be able to catch real state of several variables at a particular step. In this way, it occured I made my own debugging window to format information when trying to catch GUI events for examples.
Having a specific window for this, with a textgadget (or several if you need) is rather easy to do and you can format output easily.
But I insist on one point : when starting an application program PB internal Debugger is good enough. Just start in preparing your own debug outputs when coding larger applications or trying to catch particular events (especially when using multiple windows).
Rgrds
Francois Weil
14, rue Douer
F64100 Bayonne