debugging help?
Blitz3D Forums/Blitz3D Beginners Area/debugging help?
| ||
Hi all, I'm not new at programming, but I'm new at Blitz. I've been unable to locate any documentation on the debugging tool in BlitzPlus... is there any? There are 6 buttons in the debugger (without tooltips). The first two are quite obvious. Then there are three with arrows. Of which the first seems to be a 'step' option. The second two I can't really figure out. The last (with the mushroom-explosion) is a quit-button apparantly. I've got a for-next loop in my program which loops 800 times. It's gonna take a while to run through it with the step button. There must be an easier way... is there some way I can set a break point or so? Thanks in advance... Greetings from Holland (=excuse my poor english), Rowdy. |
| ||
Hi Rock, first of all welcome in Blitz ! The buttons on the debug window works as you described: the mushroom-expl terminates the program; the first with the arrow executes each line step by step. The second and third (if I recall fine, since I don't have blitz here), are used to step in and step out from a function. That means, if you have a function that you want execute but not step by step, you can use the step out, and the control goes back to the debugger when the function has ended. You can also put a 'breakpoint' with the command 'Stop'. It halts the process each time this command is encountered. You can put many Stop commands you like. The debug can be really handy, you have to get the grasp from it for a while, and make some experimentation. On the right side of the debug window, you can inspect the value of global and local variables, as well as type fields. You can also log values and messages on the debug window, but bare in mind that if a stop command is encountered, then you will loose the logs. If you halt the program with the 'traffic light' button on the very left of the debug window bar, your logs will not be lost. The command is: Debuglog.Print "your message here" This is useful when you don't want to stop the game, but check if the source does what you expected - ex. you can put a debuglog command inside a function that should be called, and check if it is so, and print also the values the function is called with: . . Function check_me(a,b,c) debuglog.print "check me called with: " + a + ";" + b + ";" + c You could also halt your program with the Stop command, by pressing a key: function blah() if keyhit(57) then ;space bar pressed stop ;halt the execution - warning: the log will be lost. endif end function Hope this helps, Sergio. |
| ||
there is a "stop" command which (as the name suggests !) stops the program for debugging. (look in documentation for "stop") |
| ||
Great... that's works much better! Thanks, Rowdy. |