Forcing a variable to evaluate as an object reference

David Glasgow david at
Mon Sep 11 11:39:20 EDT 2006

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

More information about the Use-livecode mailing list