• 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: Incremental Character Generator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incremental Character Generator


  • Subject: Re: Incremental Character Generator
  • From: Yosemite <email@hidden>
  • Date: Wed, 22 Nov 2000 08:15:54 -0900

this will generate the sequence "aaaa" thru "zzzz", i believe that was the
original post request ???

property num : 475254 -- decimal value of zzzz

on IncrementSeq()
set t to {}
set num to num + 1
if num > 475255 then
set num to 18280 -- decimal value of aaab
end if
set x to num - 1
repeat until x = 0
set a to x mod 26
if a = 0 then
set a to 26
end if
copy a to the beginning of t
set x to (x - a) div 26
end repeat
set seq to ""
repeat with anItem in t
set seq to seq & (ASCII character (anItem + 96))
end repeat
return seq
end IncrementSeq

IncrementSeq()
IncrementSeq()


-- hcir
mailto:email@hidden


References: 
 >Re: Incremental Character Generator (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Limiting Decimal Places in a Floating Variable?
  • Next by Date: "Out of memory" error
  • Previous by thread: Re: Incremental Character Generator
  • Next by thread: Re: Incremental Character Generator
  • Index(es):
    • Date
    • Thread