Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some doubts about your code...
Message
De
20/05/2003 11:03:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00757137
Message ID:
00790499
Vues:
32
>Cetin,
>
>The "new version"...
>
>Local pGUID,rGUID,lpVersionInfo,lcOldError,llNewVersion,lcReturn
>Declare Integer CoCreateGuid In 'OLE32.dll' String @pguid
>Declare Integer StringFromGUID2 In 'OLE32.dll' String rguid, String @lpsz, Integer cchMax
>Declare Short GetVersionEx In win32API String @ lpVersionInfo
>Declare Integer UuidCreateSequential In 'RPCRT4.dll' String @ Uuid
>lpVersionInfo = Chr(128+5*4)+Replicate(Chr(0),128+5*4-1)
>GetVersionEx(@lpVersionInfo)
>pGUID=Replicate(Chr(0),16)
>rGUID=Replicate(Chr(0),80)
>m.lcOldError = On("Error")
>llNewVersion = .T.
>On Error llNewVersion = .F.
>lcReturn = Substr(Iif(UuidCreateSequential(@pGUID)=0 .and. StringFromGUID2(pGUID,@rGUID,40)#0,Strconv(Left(rGUID,76),6),""),26,12)
>If llNewVersion = .F.
>	lcReturn = Substr(Iif(CoCreateGuid(@pGUID)=0 .and. StringFromGUID2(pGUID,@rGUID,40)#0,Strconv(Left(rGUID,76),6),""),26,12)
>EndIf
>On Error &lcOldError
>Return lcReturn
>
>
>I think now it will work great in any system any version any any any... :-)
>
>[]s!


:) Wouldn't this work :
*...
>m.lcOldError = On("Error")
On Error ;
   lcReturn = Substr(Iif(CoCreateGuid(@pGUID)=0 .and. ;
   StringFromGUID2(pGUID,@rGUID,40)#0,Strconv(Left(rGUID,76),6),""),26,12)

lcReturn = Substr(Iif(UuidCreateSequential(@pGUID)=0 .and. ;
   StringFromGUID2(pGUID,@rGUID,40)#0,Strconv(Left(rGUID,76),6),""),26,12)
On Error &lcOldError
Return lcReturn
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform