I've been using a GUID (Global Unique Identifier) routine, which came from Wiki.
Code: Select all
REM Creates Global Unique Identifier name
DEF FNguid
LOCAL guid{}, guidw%, guida%
SYS "LoadLibrary", "OLE32.DLL" TO ole32%
SYS "GetProcAddress", ole32%, "CoCreateGuid" TO CoCreateGuid%
SYS "GetProcAddress", ole32%, "StringFromGUID2" TO StringFromGUID2%
DIM guid{a%, b%, c%, d%}, guidw% 79, guida% 39
SYS CoCreateGuid%, guid{}
SYS StringFromGUID2%, guid{}, guidw%, 40
SYS "WideCharToMultiByte", 0, 0, guidw%, -1, guida%, 40, 0, 0
= $$guida%
Code: Select all
DEF FNguidsimple
LOCAL I%, G$
G$ = "{"
FOR I% = 0 TO 7
G$ += RIGHT$("000" + STR$~(RND(65536)-1), 4)
IF I% = 1 OR I% = 2 OR I% = 3 OR I% = 4 THEN G$ += "-"
NEXT
G$ += "}"
=G$
Matt