Re: Change the mod result in list
Re: Change the mod result in list
- Subject: Re: Change the mod result in list
- From: bill <email@hidden>
- Date: Fri, 23 Aug 2002 02:59:18 +0800
>
On 23/08/2002 01:54, "Michelle Steiner" <email@hidden> wrote:
>
>
> set integerList to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
>
> set N to 4
>
> set resultList to {}
>
> repeat with i in integerList
>
> set end of resultList to (i mod N) + 4 * ((i mod N = 0) as integer)
>
> end repeat
OK, I get it, ((i mod N = 0) as integer) means (true as integer).
After some checking,
{true as integer, false as integer, 1 as boolean, 0 as boolean}
-- {1, 0, true, false}
So, it's confusing now, cause in Applescript in a Nutshell, page 53, it's
quoted that "You cannot use numerical values (such as 0, 1, -1) as boolean
values2.
Interesting that there are various ways to do the same things.
Thanks.
bill
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.