Show local values
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Show local values
Hi All,
I search if there is a way to show the value of a local variable like when the debug mode = true
(like on this snapshot)
Jean-Marc
I search if there is a way to show the value of a local variable like when the debug mode = true
(like on this snapshot)
Jean-Marc
- Attachments
-
- showlocalValue.jpg (8.62 KiB) Viewed 4542 times
https://alternatic.ch
Re: Show local values
you can just put the variable, then it'll show up in the message box:
Code: Select all
put theVar
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Show local values
Jean-Marc
Can you say more about what you want? When the debugger is active, as you yourself know, a tooltip shows the value of any variable. Also, that value is displayed in the lower pane of the debugger, and can even be expanded to a separate window that stays live until dismissed. This even works with arrays, which are displayed already combined.
You can place it in the msg box as BvG indicated. But I think you are asking for something different...
Craig Newman
Can you say more about what you want? When the debugger is active, as you yourself know, a tooltip shows the value of any variable. Also, that value is displayed in the lower pane of the debugger, and can even be expanded to a separate window that stays live until dismissed. This even works with arrays, which are displayed already combined.
You can place it in the msg box as BvG indicated. But I think you are asking for something different...
Craig Newman
Re: Show local values
Salut Jean-Marc,
if you want to know what the value of a script local variable is and you are not currently in the script that holds the script local varible you could make a function in that script
if the script local variable is in the message path (card or stack script) you could just call it
if the script you are interested in is not in the message path like a button on a card you would call it
this way you can know what is the content of a script local variable from anywhere outside of the script the script local variable lives in.
then again I maybe did not understand exactly what you want.
Kind regards
Bernd
if you want to know what the value of a script local variable is and you are not currently in the script that holds the script local varible you could make a function in that script
Code: Select all
on returnTheValueOfScriptLocalsWho
return sWho
end returnTheValueOfScriptLocalsWho
Code: Select all
on mouseUp
returnTheValueOfScriptLocalsWho
put the result into field 1
end mouseUp
Code: Select all
on mouseUp
call returnTheValueOfScriptLocalsWho of button 2
put the result into field 1
end mouseUp
then again I maybe did not understand exactly what you want.
Kind regards
Bernd
Re: Show local values
Hi All,
Thank for replys and sorry for my bad english.
Kind regards
Jean-Marc
Thank for replys and sorry for my bad english.
Yes Bernd, je voudrais voir la valeur de chaque variable d'un script dans un tooltip comme quand il y a une erreur dans le script (ou un breakPoint)then again I maybe did not understand exactly what you want
Yes, Craig. I want the same behavior all the times... and the second quarter of the moon (Bernd already works for the first one)a tooltip shows the value of any variable
Kind regards
Jean-Marc
https://alternatic.ch
Re: Show local values
Hi Jean-Marc,
OK, I was off with my first response. But I still dont get what exactly you want. If you want the variables if an error occurs why dont you use the debugger? It has everything you want.
Could you give an example when and how you want to use this?
You could always put your scripts into a try/catch/end try structure. In the catch you could process your variables and do with them what you want.
Kind regards
Bernd
OK, I was off with my first response. But I still dont get what exactly you want. If you want the variables if an error occurs why dont you use the debugger? It has everything you want.
Could you give an example when and how you want to use this?
You could always put your scripts into a try/catch/end try structure. In the catch you could process your variables and do with them what you want.
Kind regards
Bernd
Re: Show local values
Guten Abend Bernd,
I want de same behavior without breakpoint or script error
I would use it to follow the value of variables with a simple "mouseenter" in the name of the variable in the script editor
Kind regards
Jean-Marc
I can see the values of each variable of a script in a tootip when the debugger is true and there is a breakpoint or a script errorOK, I was off with my first response. But I still dont get what exactly you want. If you want the variables if an error occurs why dont you use the debugger? It has everything you want.
Could you give an example when and how you want to use this?
I want de same behavior without breakpoint or script error
I would use it to follow the value of variables with a simple "mouseenter" in the name of the variable in the script editor
Kind regards
Jean-Marc
https://alternatic.ch
Re: Show local values
Hi Jean-Marc,
I am not shure if this is possible. The local variables only 'live' when the script is running. Otherwise I doubt that they have any values. In the script editor the scripts are not running. So I don't know of any way to get at the value of a variable if the script is not running. The debugger is a special case since it 'freezes' the execution of the script. And you would have to change the script editor. I don't think it is a good idea.
The alternative script editor Remo (formerly TRex) has some features that come close to what you want. You can step back through the values of a variable in time.
There are people here in the forum that know a lot more about this than I do, maybe they might want to comment on this.
Kind regards
Bernd
I am not shure if this is possible. The local variables only 'live' when the script is running. Otherwise I doubt that they have any values. In the script editor the scripts are not running. So I don't know of any way to get at the value of a variable if the script is not running. The debugger is a special case since it 'freezes' the execution of the script. And you would have to change the script editor. I don't think it is a good idea.
The alternative script editor Remo (formerly TRex) has some features that come close to what you want. You can step back through the values of a variable in time.
There are people here in the forum that know a lot more about this than I do, maybe they might want to comment on this.
Kind regards
Bernd