04-16-2008, 09:36 PM
There are several ways you can write a function for this...
There are several ways to write function for this....
' If you just want to generate a random string..use this
Now you can use the above function and tweak it according to your objective
Example:for email
There are several ways to write function for this....
' If you just want to generate a random string..use this
Code:
FUNCTION GetRandomString(LEN)
Dim intI, StrS
Const StartChr ="a", Range = 26
Randomize
StrS = ""
FOR intI = 0 TO LEN-1
StrS = StrS + Chr(asc(StartChr) + Rnd() * Range )
NEXT
GetRandomString = StrS
END FUNCTION
Now you can use the above function and tweak it according to your objective
Example:for email
Code:
Dim StrE, StrE1, StrE2, StrE3, StrE4, StrEmail
StrE = Call GetRandomString(10)
StrE1 = "@"
StrE2 = Call GetRandomString(5)
StrE3 = "."
StrE4 = Call GetRandomString(5)
StrEmail = StrE&StrE1&StrE2&StrE3&StrE4