Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Amount of RAM?
Message
 
To
19/06/2008 18:17:10
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01325584
Message ID:
01325587
Views:
17
>When I right mouse click on My Computer on the General tab I see that I have 1.50 GB of RAM installed. How can I get that information via an API or other method? The MEMORY() and some other SYS() functions did not return the information I desire.

You can try with WMI
loLocator	= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI		= loLocator.ConnectServer()
loOSs		= loWMI.ExecQuery('Select * from Win32_OperatingSystem')
for each loOS in loOSs
	with loOS
		? .FreePhysicalMemory, .FreeVirtualMemory
	endwith
endfor
[Update]

Ooops, RAM installed... Should read carefully Hugo...
loLocator	= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI		= loLocator.ConnectServer()
loCSs		= loWMI.ExecQuery('Select * from Win32_ComputerSystem')
for each loCS in loCSs
	with loCS
		? .TotalPhysicalMemory
	endwith
endfor
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform