RandomGUID

Creates a random GUID number
like ...
879AE395-E026-0A63-EFC1-152038C4400B
E79CC0E4-1216-8B6B-B276-0C5F1A0AAC20
021822AD-9CF2-3B54-F134-639480E6022F


Public

Tested

My Own Work
Function RandomGUID()
 MaxChars     = 32 ' 32 chars
 strChars     = "ABCDEF1234567890"
 strRnd     = ""
 ' 8 - 4 - 4 - 4 - 12
 Randomize Timer
 For I = 1 To 8
  strRnd    = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
 Next
 strRnd     = strRnd & "-"
 For I = 1 To 4
  strRnd    = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
 Next
 strRnd     = strRnd & "-"
 For I = 1 To 4
  strRnd    = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
 Next
 strRnd     = strRnd & "-"
 For I = 1 To 4
  strRnd    = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
 Next
 strRnd     = strRnd & "-"
 For I = 1 To 12
  strRnd    = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
 Next
 RandomGUID    = strRnd
End Function

Views 163 Downloads 38

Classic ASP Texts + Strings
ANmarAmdeen
674
Attachments
Revisions

v1.0