address fields with same name, disregarding IDs
Ken Ray
kray at sonsothunder.com
Fri Feb 4 09:00:03 EST 2005
On 2/3/05 11:37 PM, "Kresten Bjerg" <kresten.bjerg at psy.ku.dk> wrote:
> Working with problems of over-size cards I need to adress (put to) 9
> duplicates of a field, same name but 9 different IDs
> Is there an easy way?
Well, first of all, if there's any way you can get those fields to be
uniquely named, you'll be better off in the long run. I really try to stay
away from objects of the same type that have the same name because Rev will
be confused when you try to put data into the object by name.
However, if you *can't* change the names, the only way to deal with it is by
using their IDs, which could be stored in a custom property or global
variable for each reach, or simply addressed as a local variable. For
example, suppose you wanted to clear these 9 fields. You could do this:
put "1001,1002,1003,1004,1006,1009,1012,1023,1065" into tIDs
repeat for each item tID in tIDs
put empty into fld id tID
end repeat
HTH,
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the use-livecode
mailing list