Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CPU Speed & Ram Size
Message
 
 
À
14/03/2001 12:13:01
George Obergfell
Peak Software Systems
Sandy, Utah, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00484938
Message ID:
00484979
Vues:
19
>I need to find the CPU Speed (Mhz) and ACTUAL Physical Ram Size (Unless you can convince me that sys(1001) is for real).
>
>Thanks

Neil gave you the CPU info. Here is the memory.
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.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform