GUID ID
For ix=1 to 10
? getGUID()
endfor

Function getGUID
* Declare part only needs to be done once really but wouldn't matter
Declare Integer StringFromGUID2 In 'OLE32.dll' ;
   string rguid, String @lpsz, Integer cchMax
Declare Integer UuidCreate In 'RPCRT4.dll' String @pguid

Local pGUID,rGUID
pGUID=Replicate(Chr(0),16)
rGUID=Replicate(Chr(0),80)
return Iif(Inlist(UuidCreate(@pGUID),0,1824),;
   Iif(StringFromGUID2(pGUID,@rGUID,40) # 0, ;
   Strconv(Left(rGUID,76),6), ""),"") && 1824 = LOCAL_ONLY



GUID Wiky



How To Obtain a GUID in Visual FoxPro (Microsoft)



*** Run this once at the beginning of your app (in your MAIN.PRG) to declare the calls.

DECLARE INTEGER CoCreateGuid ;
  IN Ole32.dll ;
  STRING @lcGUIDStruc
DECLARE INTEGER StringFromGUID2 ;
  IN Ole32.dll ;
  STRING cGUIDStruc, ;
  STRING @cGUID, ;
  LONG nSize

*** Run this as required to get a unique key.

? getGUID()

PROCEDURE GetGUID
cStrucGUID=SPACE(16)
cGUID=SPACE(80)
nSize=40
IF CoCreateGuid(@cStrucGUID) # 0
   RETURN ""
ENDIF
IF StringFromGUID2(cStrucGUID,@cGuid,nSize) = 0
  RETURN ""
ENDIF
RETURN STRCONV(LEFT(cGUID,76),6)
ENDPROC



procedure IntGUID(tnInt)
  return stuff("{00000000-0000-0000-0000-000000000000}",;
    26,12,padl(m.tnInt,12,'0'))
endproc

38 bytes