HOWTO: Determining the Amount of Physical RAM on a Mac from VFP

Last reviewed: July 30, 1997
Article ID: Q170814
The information in this article applies to:
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SUMMARY

There is no function available in Visual FoxPro for the Macintosh that provides information on the amount of physical RAM on the machine. However, the Ram selector of the FxGestalt()function in the FoxTools.cfm library provides information on the amount of physical RAM installed on a machine.

MORE INFORMATION

The following code example returns the amount of physical RAM installed on the machine. The function ignores any virtual memory. This code returns an integer indicating the amount of physical RAM.

In the Command window or a program, enter the following lines of code:

   SET LIBRARY TO Home()+"foxtools.cfm"
   ram_amt=0
   i=FxGestalt("ram ",@ram_amt)
   ? INT(ram_amt/1024/1024)

Notice a space exists after the "Ram" selector in the FxGestalt function. Omitting this space causes the function to fail and return a -1.

All the selectors of the FxGestalt function are four letters long. The Help file states this fact in the Syntax section. The example in the FoxTools Help file, however, is not quite clear on this point. Since the space character is not easily seen in the example, it is easy to overlook it.

REFERENCES

FoxTools Help file located in the Microsoft Visual FoxPro:Tools folder

Keywords          : FxprgFoxtools VFoxMac
Version           : MACINTOSH:3.0b
Platform          : MACINTOSH
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.