How do I remotely change the selectedText of a button and then save it?

Klaus Major klaus at major-k.de
Fri Mar 31 17:56:41 EST 2006


HI William,

> Hi there,
>
> I have a btn "options" on card "test" of stack 'B' with 5 options from
> 1.1 to 1.5 .
> On stack 'A' I have a 'check' button and I remotely try to change one
> of the options and then save it. On the 'check' button I use:
> on mouseUp
> if field "score" = 5 then set the label of btn "options" of card
> "test" of stack "B" to "1.2"
> send mouseup to button "save" of card "test" of stack "B"
> end mouseUp
>
> On the 'save' button I use:

Try this:

##put the selectedtext of btn "options" into tData
put the label of btn "options" into tData

> put tData into field "options" of card "test" of stack A.
>
> Of course the label is changed into "1.2" but field "options" of card
> "test" of stack A is not and the options 1.1 to 1.5 are gone in btn
> "options".
> I am doing something wrong with the selected text and label in my  
> code.
> Can anyone help me please?

I guess there is no currently selected text in that button, so the label
(which is "the selectedtext" of that button acutually) might do the  
trick.

Maybe not  ;-)

> William de Smet

Groetjes

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the Use-livecode mailing list