Change the mod result in list
Change the mod result in list
- Subject: Change the mod result in list
- From: bill <email@hidden>
- Date: Fri, 23 Aug 2002 01:14:54 +0800
Hello,
Suppose an integer list with the following calculation,
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
end repeat
-- {1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0}
Is there any possible way to convert each 0 to 4? Like this one:
{1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}
TIA
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.