Getting GUID

  1. 4 years ago

    Roberto C

    8 Jan 2015 Pre-Release Testers, Xojo Pro Europe (Milan, Italy)

    I had problems in getting GUID on Mac, Windows and Linux…
    I found a solution:

    Function Method_Generate_GUID() As String
      Dim db As New SQLiteDatabase
      Dim Sql_instruction As String= "select hex( randomblob(4)) " _
      + "|| '-' || hex( randomblob(2)) " _
      + "|| '-' || '4' || substr( hex( randomblob(2)), 2) " _
      + "|| '-' || substr('AB89', 1 + (abs(random()) % 4) , 1) " _
      + "|| substr(hex(randomblob(2)), 2) " _
      + "|| '-' || hex(randomblob(6)) AS GUID"
      If db.Connect Then
        Dim GUID As String = db.SQLSelect(Sql_instruction).Field("GUID")
        Return  GUID
        db.Close
      End If
    End Function

    Perhaps it might be helpful to someone else :)

    Rob

  2. Oliver O

    8 Jan 2015 Pre-Release Testers, Xojo Pro https://udemy.seminar.pro

    http://forums.realsoftware.com/viewtopic.php?f=1&t=44203&start=13

  3. John H

    9 Jan 2015 Pre-Release Testers Planet earth
    Edited 4 years ago

    An online GUID (UID) generator. https://www.guidgenerator.com/

    Info: http://en.wikipedia.org/wiki/Globally_unique_identifier

    Seems also to be a version 5 Info: http://en.wikipedia.org/wiki/Universally_unique_identifier

or Sign Up to reply!