Forcing a variable to evaluate as an object reference
Mark Schonewille
m.schonewille at economy-x-talk.com
Mon Sep 11 14:19:38 EDT 2006
David,
Does this work for you?
on yeschangeit
global glanguage
put "changing it now"
repeat for each line i in field "langfields"
-- put "field " & i into twhere
get the Language[glanguage] of fld i
put it into field i
end repeat
end yeschangeit
Best ,
Mark
--
Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Get your store on-line within minutes with Salery Web Store software.
Download at http://www.salery.biz
Op 11-sep-2006, om 17:39 heeft David Glasgow het volgende geschreven:
> I have the strange feeling I really should know the answer to this,
> but my mind is blank.
>
> I have written a routine for switching languages of the text
> contained in a number of fields (listed in field "langfields"). The
> fields are on various cards, and are listed in "langfields" in the
> form:
>
> "Inst3" of card "Ranking" of this Stack
>
> The different language texts are stored in a custom property set
> 'Language' in each of the respective objects.
>
> When the script runs, the text is retrieved from the custom
> property set glanguage, but the "put it into field i" generates a
> 'no such object' error. I have tried different forms of syntax,
> brackets and whatnot, but either get the no object error, or the
> text is put into the variable 'i' rather than into the relevant
> 'field i'. I originally tried doing the get and put into the
> field in one line, but broke it in to steps to see where it was
> failing.
>
> on yeschangeit
> global glanguage
> put "changing it now"
> repeat for each line i in field "langfields"
> put "field " & i into twhere
> get the Language[glanguage] of twhere
> put it into field i
> end repeat
> end yeschangeit
>
>
> Best Wishes,
>
> David Glasgow
> Carlton Glasgow Partnership
>
> http://www.i-psych.co.uk
More information about the use-livecode
mailing list