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: Deivy Petrescu <email@hidden>
- Date: Sat, 23 Mar 2013 09:43:44 -0400
On Mar 23, 2013, at 01:55 , Jon Pugh <email@hidden> wrote:
>
> property a_list : {"a"}
> repeat with an_item in a_list
> display dialog an_item --displays "a" (without quotes)
> contents of an_item is "a" --FALSE!
> end repeat
>
> In this scenario, the variable of a repeat loop, an_item, is a reference, specifically “item 1 of a_list”. Realizing this will make your life so much better. You can get the contents of a reference to do what you expect.
>
> It’s not that mysterious.
>
> Jon
>
Jon,
You certainly mean: contents of an_item is "a" --TUE! as in not false
I normally write my loops of this kind as
repeat with an_item in a_list
set an_item to contents of an_item
…
end repeat
Normally with this kind of code I get an_item to be what I expect it to be.
Deivy Petrescu
email@hidden
_______________________________________________
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