Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get disk size and memory
Message
De
08/12/2003 10:34:44
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00856759
Message ID:
00856826
Vues:
26
>Thanks Borislay, but can you please show me
>how to get total size of RAM ?

* I copied this for somewhere but have never tested it:

* RAM memory routine
clear
local lcmemstatus
lcmemstatus = chr(0)+chr(2)+replicate(chr(0),30)
declare GlobalMemoryStatus in kernel32 string@ lcmemstatus
GlobalMemoryStatus(@lcmemstatus)
? 'Total Physical Memory = ' + transform(DWORDtoNUM(substr(lcmemstatus,9,4))) +' bytes'
? 'Avail Physical Memory = ' + transform(DWORDtoNUM(substr(lcmemstatus,13,4))) +' bytes'
return

function DwordToNum
lparameter tcDWORD
local ln0,ln1,ln2,ln3
ln0=asc(subs(tcDWORD,1,1))
ln1=asc(subs(tcDWORD,2,1)) * (256)
ln2=asc(subs(tcDWORD,3,1)) * (256^2)
ln3=asc(subs(tcDWORD,4,1)) * (256^3)
if ln3+ln2+ln1+ln0 < 2^31 then
return ln3 + ln2 + ln1 + ln0
else
return (-1)*((2^32)-(ln3 + ln2 + ln1 + ln0))
endif
* This works if you have less than 2GB of RAM installed.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform