• 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: Michelle Steiner <email@hidden>
  • Date: Tue, 21 Nov 2000 18:32:32 -0800

On 11/21/00 2:14 PM, Greg Strange <email@hidden> wrote

>I am trying to get a sequential, incremental increase of a string. It is
>easier to explain through example.
>
>I want to take, say, four characters, say : aaaa
>
>and increment them through aaab, aaac, aaad, aaae, aaaf, aaag, aaah, etc.
>and then it rolls over and goes aaba, aabb, aabc, aabd, aabe, aabf, etc.
>until it would end with zzzz. This of course would generate (assumption of
>32 letters in the alphabet) 32^4 strings.
>
>The number of characters in the string could be as many as 20. How would I
>begin with this projekt?
>
>Thank you for your help.

This is very brute force, and someone else may have a more elegant way of
doing it, but it works.

--Michelle

repeat with loop1 from 1 to 26
repeat with loop2 from 1 to 26
repeat with loop3 from 1 to 26
repeat with loop4 from 1 to 26
set test to (ASCII character (loop1 + 96)) & (ASCII character (loop2
+ 96)),
& (ASCII character (loop3 + 96)) & (ASCII character (loop4 + 96))
--do something with test
end repeat
end repeat
end repeat
end repeat

----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------


  • Prev by Date: Re: Incremental Character Generator
  • Next by Date: Re: Adding addresses to Eudora Nickname
  • Previous by thread: Re: Incremental Character Generator
  • Next by thread: Re: Incremental Character Generator
  • Index(es):
    • Date
    • Thread