Re: Strings as list items don't always compare as strings
Re: Strings as list items don't always compare as strings
- Subject: Re: Strings as list items don't always compare as strings
- From: Stan Cleveland <email@hidden>
- Date: Mon, 25 Mar 2013 12:22:50 -0700
On Mar 23, 2013, at 6:43 AM, Deivy Petrescu wrote:
> I normally write my loops of this kind as
>
> repeat with an_item in a_list
> set an_item to contents of an_item
Hi Rob,
In my code, I've standardized on this format for iterating though lists:
set theList to {"a", "b", "c", 3, 4, 5}
repeat with i from 1 to (length of theList)
set thisItem to item i of theList
-- do something with thisItem
end repeat
The variable thisItem will contain the actual objects in the list, rather than references, so casting (as text, for instance) or dereferencing (to contents of) are unnecessary.
FWIW,
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden