Posted: 12th Nov 2003 5:38
Ever wondered what the value of a variable was at a certain point in your code? This function (though not fancy) will display a value and wait for the user to either click the ok button or press the enter key.

I think if you've been using Dark Basic Pro for awhile and you run this demo, you will appreciate it's usefulness.

Not as easy as debugging in Visual Basic, but still alot better!


Please let me know what you think.

Cheers
Posted: 12th Nov 2003 8:13
i like my method better because its simple....

Call the function as

Debug(0,0,"Debug text")

to comment out, just do a search/replace for debug(
and replace as `debug(
and done.
Posted: 12th Nov 2003 15:38
waffle:
that's good... unless the program at that point is updating a bitmap other than the screen (bitmap 0), because the TEXT would write to that bitmap instead of the screen. tho it sounds like you're not doing that so.... you'd be fine!

i noticed you didn't have any kind of debouncing code when the user presses the spacebar, if you were checking values in a loop (building an array for example) you might hold down the space bar too long and miss seeing a value, you might want to check the SOURCE button below for a slight change to prevent debouncing:
(this means that the user has to press AND release the space key before the routine will continue.)
Posted: 13th Nov 2003 4:20
arrrrrgh!

I tried my function in another program an it didn't work right!

I guess maybe I goofed!

back to the drawing board.
Posted: 13th Nov 2003 11:28
sorry, but I have it that way in the code base and my apps. I guess i just left that part out.
Posted: 16th Nov 2003 2:32
just puch escape and use the CLI!
Posted: 16th Nov 2003 5:39
the CLI is next to useless. the variable watch crashes every time and typing any command in the CLI causes it to not be able to resume program execution (what use is that?). not to mention the program stepthru line numbers are messed up by #CONSTANT (which i use all the time).