Collecting card field info...
Jan Schenkel
janschenkel at yahoo.com
Tue Aug 26 05:16:01 EDT 2003
--- Gary Rathbone <gary.rathbone at btclick.com> wrote:
> I've got a small project with a data capture
> requirement. Users create
> their own fields, so I'm looking for something
> like...
>
> Repeat for the number of cards in this stack --1
> Repeat for each field on this card --2
> Put the name of this field after gFieldList
> End--2
> End --1
>
> Once I know the reference of each field I can grab
> the contents and
> process accordingly.
>
> Can anyone assist with the syntax?
> Many Thanks
>
> Gary Rathbone
>
Hi Gary,
You were actually almost there :-)
-- gather the long ID of all fields
repeat with i = 1 to the number of cards
repeat with j = 1 to the number of fields \
of card i
put the long ID of fld j of card i & return \
after tFieldIDList
end repeat
end repeat
-- remove the trailing return
delete char -1 of tFieldIDList
-- now process the data in the fields
repeat for each line tFieldID in tFieldIDList
-- ...
end repeat
Using the long ID instead of the name ensures that you
get _all_ the correct data, even if there are two
fields on the same card with the same name.
Hope this helped,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
More information about the use-livecode
mailing list