Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GUID code
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01007105
Message ID:
01007114
Views:
14
There's no difference between them because the second one internaly uses the first one. However the second one may not be present on a computer if it doesn'r have WSH installed.

>I found these 2 examples of GUID code on FoxWiki.
>
>Which of the 2 would be more reliable?
>
>
>PROCEDURE guid
>	LOCAL lcPK,lcBuffer,i,lnHex,lnUpper,lnLower
>	DECLARE INTEGER CoCreateGuid IN OLE32.DLL STRING @lcBuffer
>	lcBuffer=SPACE(17)
>	lcPK=SPACE(0)
>	IF CoCreateGuid(@lcBuffer) = 0
>		FOR i=1 TO 16
>			lnHex=ASC(SUBSTR(lcBuffer,i,1))
>			lnUpper=INT(lnHex/16)
>			lnLower=lnHex-(lnUpper*16)
>			lcPK=lcPK+SUBSTR('0123456789ABCDEF',lnUpper+1,1)+;
>				SUBSTR('0123456789ABCDEF',lnLower+1,1)
>		ENDFOR
>	ENDIF
>	RETURN lcPK
>	ENDPROC
>
>FUNCTION guid2
>
>IF VAL(LEFT(VERSION(4), 2)) > 6
>	oGUID = CreateObject("scriptlet.typelib")
>	cGUID = Strextract(oGUID.GUID, "{", "}" )
>ELSE
>	** "VFP 6"
>	oGUID = CreateObject("scriptlet.typelib")
>	cGUID = substr( oGUID.GUID, 2, 36 )
>ENDIF
>
>RETURN cGUID
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform