Re: Incremental Character Generator
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