Message Box doesn't update variables correctly
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Message Box doesn't update variables correctly
I'm new to LiveCode, so point me toward info on this if I've missed it somewhere!
I'm debugging an app, and I can't get Global Variables to update correctly in the Message Box. If I scroll to the variable I want to check and run the game, the variable status on the right side doesn't update until I click another variable, then click back on the one I want to check.
For example, assume I have Variable1 and Variable2. Variable2 should +1 every time I do something correctly in the game. If the listing in the Message Box is sitting on Variable2 and I do two correct actions, there is no update--the variable reads 0. If I click on Variable1's listing in the Message Box, then on Variable2's listing again, it correctly says 2.
That really slows down the kind of debugging where you need to watch variables change over time. Am I missing a better way to do this, or is the window buggy?
Thanks!
I'm debugging an app, and I can't get Global Variables to update correctly in the Message Box. If I scroll to the variable I want to check and run the game, the variable status on the right side doesn't update until I click another variable, then click back on the one I want to check.
For example, assume I have Variable1 and Variable2. Variable2 should +1 every time I do something correctly in the game. If the listing in the Message Box is sitting on Variable2 and I do two correct actions, there is no update--the variable reads 0. If I click on Variable1's listing in the Message Box, then on Variable2's listing again, it correctly says 2.
That really slows down the kind of debugging where you need to watch variables change over time. Am I missing a better way to do this, or is the window buggy?
Thanks!
Re: Message Box doesn't update variables correctly
Hi.
You surely mean the debugger. The message box is a cute gadget where you can enter commands, and see other things.
The debugger is where you stop execution and see the value of variables, global or otherwise. If you place this in a button :
Do you not see the value change as you step through? I do. Note I used the hard "breakPoint" command here. I am not sure how experienced you are with soft ones.
Now try this:
After a few passes, note that there is a magnifying glass on the right side of the debugger window on the "temp" line. Click it. Now make a few more passes.
Write back if none of this works out for you, and welcome to the forum.
Craig Newman
You surely mean the debugger. The message box is a cute gadget where you can enter commands, and see other things.
The debugger is where you stop execution and see the value of variables, global or otherwise. If you place this in a button :
Code: Select all
on mouseUp
global qq
put 0 into ww
breakpoint
repeat 3
put random(99) into qq
add 3 to ww
end repeat
end mouseUp
Now try this:
Code: Select all
on mouseup
breakpoint
repeat 20
put random(99) & return after temp
end repeat
end mouseup
Write back if none of this works out for you, and welcome to the forum.
Craig Newman
Re: Message Box doesn't update variables correctly
Thanks for the info! 
I knew about the debugger, but I was hoping to be able to watch variables change while playing, without having to step through code. Is there a way to get that section of the Code window to update without a break point?

I knew about the debugger, but I was hoping to be able to watch variables change while playing, without having to step through code. Is there a way to get that section of the Code window to update without a break point?
Re: Message Box doesn't update variables correctly
It is common practice to place certain results into the msg box now and then This is convenient on occasion, and simple and accessable. It would be tedious, however, to try to make it a tool that even approaches the debugger.
The debugger is your friend. Play around with it. It is indespensible, comforting, simple and very powerful .
Craig Newman
The debugger is your friend. Play around with it. It is indespensible, comforting, simple and very powerful .
Craig Newman
Re: Message Box doesn't update variables correctly
Craig,
I think Laralyn is talking about the "global properties" window in the message box. You have to click on the little icon of the "world" to see it (and you have to click the triangle over at the far right to even see the icons) And yes, Laralyn the message box is about as buggy as it gets. I came across your post because for the past few hours I can't even get the darn thing to respond at all to my commands. It's just ... dead.
Mark
I think Laralyn is talking about the "global properties" window in the message box. You have to click on the little icon of the "world" to see it (and you have to click the triangle over at the far right to even see the icons) And yes, Laralyn the message box is about as buggy as it gets. I came across your post because for the past few hours I can't even get the darn thing to respond at all to my commands. It's just ... dead.
Mark
Re: Message Box doesn't update variables correctly
Mark.
I answered your other post. Click in the lower field in the single line pane of the msg box and type a return. This fixes this intermittant issue, at least for the session you are in.
Craig
I answered your other post. Click in the lower field in the single line pane of the msg box and type a return. This fixes this intermittant issue, at least for the session you are in.
Craig