WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Random Alpha Numeric Number


Question:

Is there a function for creating a random alpha numeric number?

Answer:

char = Random(35)
If char > 9 Then char = Num2Char(char + 55)
Message("Random character", char)
Or perhaps:
#DefineFunction RandomAlpha(Length)
Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Text = ""
For x = 1 To Length
Text = StrCat(Text,StrSub(Chars,Random(61)+1,1))
Next
Return Text
#EndFunction

Article ID:   W17018
File Created: 2007:07:03:14:27:38
Last Updated: 2007:07:03:14:27:38