Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sdt51j.zip - hex2decimal syntax err?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Divers
Thread ID:
00502557
Message ID:
00502709
Vues:
23
Hi George,

And if I read the multitude of messages about VFP7, this is *FIXED* in that release.
Is that correct?

JimN

>>I just unzipped sdt51j.zip and do the update app. Then I recomiple the sdt project into an app.
>>
>>I did have sdt51i installed and everything hunky doree.
>>
>>Problem is I think my 51j has a syntax err. When I tried to reindex programatically I get a error in VMP5 stating "can't find hex2decimal.prg" error.
>>
>>The line of code is in sdtutility/getDriveSpace() line 68 listed below:
>>
>>     declare short GetDiskFreeSpaceEx in Win32API ;
>>          string @lpDirectoryName, string @lpFreeBytesAvailableToCaller, ;
>>          string @lpTotalNumberOfBytes, string @lpTotalNumberOfFreeBytes
>>     store replicate(chr(0), 8) to lcCaller, lcTotal, lcFree
>>     if GetDiskFreeSpaceEx(@lcDir, @lcCaller, @lcTotal, @lcFree)  0
>>68          lnResult = Hex2Decimal(iif(tlTotal, lcTotal, lcFree))
>>     endif GetDiskFreeSpaceEx(@lcDir, ...

>>
>>My question is, shouldn't this line be modified by placing a . in front of the Hex2Decimal call as shown below:
>>
>>68          lnResult = .Hex2Decimal(iif(tlTotal, lcTotal, lcFree))
>>
>>


>>
>>What happens is the program crashes in the middle of a re-index and my indexes are lost. (Yuck)
>
>Deamon,
>
>As you can probably tell the routine is retrieving the total or free amount of diskspace. The function Hex2Decimal simply takes a string representing the value (which is stored in a string because it's a 64 bit integer and VFP can't handle that size) and converts it (it's in LSB to MSB format). I don't know exactly how Doug's code accomplishes it, but it's no doubt the same way I do. Now the reason that he's doing this is that VFP's functions to retrieve these values call functions that cap the value at 2 gb and, therefore, are unreliable. You can see how I make this conversion in my FAQ "Workaround for SYS(2020)/DISKSPACE() bug" which uses the function shown above.

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform