Challenge: how to set the text of a field

David Bovill david at architex.tv
Fri Mar 29 05:08:50 EDT 2013


OK - a very basic challenge for all you LIveCode wizz kids out there :) How
do you set the text of a field. The twist is you need to do it for a group
which has been placed on multiple card, so there is the text on card 1 and
this is different from the text on card 2. The difficulty is that you want
to use a behavior of a group, so that you can refer to the text of the
"Title" field (there are two fields in the group - one called "Title" and
one called "Body").

The problem is based on the fact that while you can get "the text of fld
"Title" of card 2" - the title_Text of group "Title" of card 2 does not
work - it returns the text of the "Title" field of the current card. So how
do you do this?

Here are the sample handlers (that don't work):

getprop title_Text
>    return the text of fld "Title" of me
> end title_Text
>
> setprop title_Text someText
>    set the text of fld "Title" of me to someText
> end title_Text
>

To make it easier to test you can use a setprop (or any handler placed in
the stack script). The only way I can do this is by a horrible hack - is
anyone up to the challenge?



More information about the Use-livecode mailing list