Quick Search
Social Sites
Lotus Community


« Return elements from a list which contain a substring | Main | Interesting if intimidating experience »
Wednesday
Dec222004

Convert Domino UniversalID into a GUID

Just about the simplest bit of LotusScript ever but one I use again and again. It converts a UNID (32 character hex string) into a GUID (for use in SQL Server in my case but pretty universal).

Function convertUNIDToGUID(strUNID) As String
  Dim strGuid As String
  If Instr(strUNID, "-") = 0 Then
    strGuid = Mid$(strUNID, 1, 8) & "-"
    strGuid = strGuid & Mid$(strUNID, 9, 4) & "-"
    strGuid = strGuid & Mid$(strUNID, 13, 4) & "-"
    strGuid = strGuid & Mid$(strUNID, 17, 4) & "-"
    strGuid = strGuid & Mid$(strUNID, 21)
  End If
  convertXRDominoIDToGUID = strGuid
End Function

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>