Re: How to retrieve items from list?
Re: How to retrieve items from list?
- Subject: Re: How to retrieve items from list?
- From: Paul Skinner <email@hidden>
- Date: Tue, 05 Dec 2000 17:00:14 -0500
>
I bought Danny Goodman's book (GREAT!), and am reading and learning
>
as
>
fast as I can -- but mastering this one feat is harder than I
>
imagined.\
I know when I started, it all seemed whacked.
the most basic way...
set thelist to {"one", "two", "three"}
repeat with x from 1 to the length of thelist
set itemname to item x of thelist
end repeat
or neater...
repeat with thisitem in thelist
set thisitem to thisitem as text
--this converts a reference (item 1 of thelist of +script;) to "one"
end
--
Paul Skinner
Ron Chapple Studios
>
Assuming I have a list containing say, 15 items:
>
>
set itemList to {"one", "two", "three", "four", "five"...} -- and
>
so on to "fifteen"
>
>
How can I structure a repeat loop that will retrieve, incrementally,
>
>
left to right, one item with each repetition and make it the value
>
of
>
a variable (itemName)?
>
Michael