Re: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)
Re: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)
- Subject: Re: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)
- From: "Arthur J Knapp" <email@hidden>
- Date: Fri, 16 Mar 2001 12:46:31 -0500
>
Date: Thu, 15 Mar 2001 13:43:06 -0800
>
From: Jed Verity <email@hidden>
>
property serialList : {}
>
property newSerialNo : {}
>
>
repeat with i from 1 to 100
>
set newSerialNo to {}
>
repeat 10 times
>
my RandomCharacter()
>
end repeat
>
set end of serialList to (newSerialNo as string)
>
end repeat
>
>
on RandomCharacter()
>
set randomASCII to (random number from 48 to 122)
>
set end of newSerialNo to ASCII character randomASCII
>
end RandomCharacter
Good stuff. :)
I have slightly speeded up your script by rewritting
RandomCharacter(). This way, you can avoid those 2000
osaxen calls:
-- ASCII characters 48 thru 122.
--
-- You can just type out sSerialChars as a literal
-- string, (I just wanted to avoid the linebreak
-- issue).
--
property sUpperC : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
property sLowerC : "abcdefghijklmnopqrstuvwxyz"
property sDigits : "0123456789"
property sSymbol : ":;<=>?@[\\]^_`"
--
property sSerialChars : sUpperC & sLowerC & sDigits & sSymbol
on RandomCharacter()
set end of newSerialNo to some item of sSerialChars
end RandomCharacter
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.LateNightSW.com