would like to press a button and have the label of that button toggle between ON and OFF ...
Instead of if, use case in one step:
Set Variable ( $$buttonLabel ;Case ( $$buttonLabel = "off" ; "on" ; "off" ) )
Set Variable ( $$buttonLabel ;
Case ( $$buttonLabel = "off" ; "on" ; "off" )
Sent from miPhone
search for merge variable and use that for the label.
Its a graphical object that shows a variable that you can set with a script.
another option is to use two buttons, one "off" and one "on", and hide them conditionally.
Your button's script can include the following code:
if [$$buttonLabel = "on" ]
Set Variable [ $$buttonLabel ; "off" ]
Set Variable [ $$buttonLabel ; "on" ]
Refresh Object ["buttonLabel" ]
the object containing the merge variable (<<$$buttonLabel>>) has to be named "buttonLabel" In the inspector.
If the button is part of a button bar you just use the variable without the << >> brackets.
but scripting the If breaks out the different steps in a manner that "newbies" reading this discussion may find easier to follow.
thank you so much everyone ... used everyone's comments to get it working!
loved the IF statement first (very clear what is happening), and then (as stated) could use the CASE ...
thanks!!! it was the <<$$buttonLabel>> part that helped and then, of course the IF statement!
appreciate the help ...
yep and your using a merge variable as i suggested
yes, thanks! ... didn't know about merge variables ... but now I do ... !!
Retrieving data ...