• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Change the mod result in list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Change the mod result in list
      • From: Michelle Steiner <email@hidden>
    • Re: Change the mod result in list
      • From: Helmut Fuchs <email@hidden>
  • Prev by Date: Re: Renaming files in list in batch
  • Next by Date: RE: Plotting question
  • Previous by thread: Re: Renaming files in list in batch
  • Next by thread: Re: Change the mod result in list
  • Index(es):
    • Date
    • Thread