Re: how to get the zero's out of a list
Re: how to get the zero's out of a list
- Subject: Re: how to get the zero's out of a list
- From: Nigel Garvey <email@hidden>
- Date: Sat, 10 Mar 2001 11:29:05 +0000
John W Baxter wrote on Fri, 9 Mar 2001 18:32:17 -0800:
>
And I was disappointed not to see at least one reply like
>
>
set testlist to {"0", "1", "0", "4"}
>
repeat with anItem in testlist
>
if contents of anItem is "0" then set contents of anItem to ""
>
end repeat
>
testlist
>
>
along with probably a sentence or three about those "contents of" phrases
>
(are both really needed in this case?...I just tossed them in to be "safe").
Yes. As you know, anItem is a reference whose value is 'item (whatever)
of testlist'. The first 'contents of' is needed for the equality test, as
references aren't automatically resolved for these. The second, of
course, changes the value of the list item referred to by anItem rather
than that of anItem itself.
NG