• 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
Re: Odd & Even Pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd & Even Pages


  • Subject: Re: Odd & Even Pages
  • From: Ian Ferguson <email@hidden>
  • Date: Fri, 24 Oct 2003 14:04:25 -0400

I would suggest doing this using "mod":

set odd_list to {}
set even_list to {}

repeat with i from 1 to 100
if i mod 2 is 1 then
set end of odd_list to i
else
set end of even_list to i
end if
end repeat

On Oct 24, 2003, at 1:23 PM, Michelle Steiner wrote:

set the number_list to {}
repeat with i from 1 to 100
set the number_list to the number_list & i
end repeat
set even_list to even(number_list)
set odd_list to odd(even_list)

on even(inlist)
set temp to {}
repeat with this_number in inlist
set temp to temp & (this_number * 2)
end repeat
return temp

end even

on odd(inlist)
set temp to {}
repeat with this_number in inlist
set temp to temp & (this_number - 1)
end repeat
return temp
end odd
odd_list
_______________________________________________
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: Odd & Even Pages
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Odd & Even Pages (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Copy items
  • Next by Date: Re: Odd & Even Pages
  • Previous by thread: Re: Odd & Even Pages
  • Next by thread: Re: Odd & Even Pages
  • Index(es):
    • Date
    • Thread