Page 1 of 1
Show local values
Posted: Thu Mar 03, 2011 11:00 pm
by jmburnod
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
Re: Show local values
Posted: Fri Mar 04, 2011 12:02 am
by BvG
you can just put the variable, then it'll show up in the message box:
Re: Show local values
Posted: Fri Mar 04, 2011 12:25 am
by dunbarx
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
Re: Show local values
Posted: Fri Mar 04, 2011 12:31 am
by bn
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
Code: Select all
on returnTheValueOfScriptLocalsWho
return sWho
end returnTheValueOfScriptLocalsWho
if the script local variable is in the message path (card or stack script) you could just call it
Code: Select all
on mouseUp
returnTheValueOfScriptLocalsWho
put the result into field 1
end mouseUp
if the script you are interested in is not in the message path like a button on a card you would call it
Code: Select all
on mouseUp
call returnTheValueOfScriptLocalsWho of button 2
put the result into field 1
end mouseUp
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
Re: Show local values
Posted: Fri Mar 04, 2011 10:06 am
by jmburnod
Hi All,
Thank for replys and sorry for my bad english.
then again I maybe did not understand exactly what you want
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)
a tooltip shows the value of any variable
Yes, Craig. I want the same behavior all the times... and the second quarter of the moon (Bernd already works for the first one)
Kind regards
Jean-Marc
Re: Show local values
Posted: Fri Mar 04, 2011 11:18 am
by bn
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
Re: Show local values
Posted: Fri Mar 04, 2011 11:56 pm
by jmburnod
Guten Abend 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?
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 error
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
Re: Show local values
Posted: Sat Mar 05, 2011 12:07 am
by bn
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