On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> <http://fox.wikis.com/wc.dll?Wiki~GUID~VFP>
>
> Simple how to make a guid in VFP.  Simple did I say?
>
> Bad Steve!

Does depend on your definition of 'simple' oc.....

A+
jml



PROCEDURE CreateGUID
********************
*** Author: Rick Strahl, West Wind Technologies
*** http://www.west-wind.com/
*** Modified: 01/26/98
*** Function: Creates a globally unique identifier using Win32
*** COM services. The value is guaranteed to be unique
*** Format: {9F47F480-9641-11D1-A3D0-00600889F23B}
*** Return: GUID as a string or "" if the function failed
*************************************************************************

DECLARE INTEGER CoCreateGuid IN Ole32.dll ;
 STRING @lcGUIDStruc

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

*** Simulate GUID strcuture with a string
lcStruc_GUID = REPLICATE(" ",16)
lcGUID = REPLICATE(" ",80)
lnSize = LEN(lcGUID) / 2
IF CoCreateGuid(@lcStruc_GUID) # 0
 RETURN ""
ENDIF

*** Now convert the structure to the GUID string
IF StringFromGUID2(lcStruc_GUID,@lcGuid,lnSize) = 0
 RETURN ""
ENDIF

RETURN SUBSTR(StrConv(LEFT(lcGUID,76),6),2,36)
* CreateGUID
* -----


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to