Any comments/suggestions are appreciated.
Lucas
dim a, b
a=Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
b=Array(-1,1,0)
dim randstring
Function RandomNumber(intHighestNumber)
Randomize
RandomNumber = Int(Rnd * intHighestNumber) + 1
End Function
randomloopnum = RandomNumber(30)
Do While randomloopnum < 15
randomloopnum = RandomNumber(30)
Loop
icount = 0
Do While icount < randomloopnum
randomnumnum = RandomNumber(2)
if b(randomnumnum) = 1 then
randstring = randstring & RandomNumber(99)
elseif b(randomnumnum) = 0 then
randomarrnum = RandomNumber(25)
randomarraystuff = a(randomarrnum)
randomarrupper = RandomNumber(2)
randomarrupperi = b(randomarrupper)
if randomarrupperi = 0 then
randstring = randstring & UCase(randomarraystuff)
elseif randomarrupperi = 1 then
randstring = randstring & randomarraystuff
end if
end if
icount = icount+1
Loop
Response.Write randstring
can use it for that reson.
S. A. Hasnut
MCSD, CIW A
It Magnet
http://itmagnet.com.au
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Option Explicit
MsgBox GetRandomString( 15)
Function GetRandomString( strLength)
const ascLbound = 32 ' 0 to 31 are nonprintable
const ascUbound = 127 'ASCII character set is the same as the first 128
characters
Dim i, sRandom
Randomize()
sRandom = ""
For i = 1 to strLength
sRandom = sRandom & Chr(( ascUbound - ascLbound + 1) * Rnd +
ascLbound)
Next
GetRandomString = sRandom
End Function