Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Guid
Message
From
12/04/2005 08:25:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Guid
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01003650
Message ID:
01003663
Views:
16
>To All,
>
>In sql2k there is a newid() function that returns a guid, is there something similar in vfp, either a function or a routine?
>
>Thanks.
>
>Frank
	Procedure getUniqueID() As String
		Declare Integer UuidCreate In 'RPCRT4.dll' String @pguid
		Declare Integer StringFromGUID2 In 'Ole32.dll' ;
			string rguid, String @lpsz, Integer cchMax
		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
	Endproc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform