Error getting tags :
error 404Error getting tags :
error 404 hasMemory | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
hasMemory
Basics
Expander triangle
Type
Function
Syntax
the hasMemory of bytes hasMemory(bytes)
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns true if the specified amount of memory is available, false otherwise.
Examples

hasMemory(2*1024*1024) -- returns true if 2M available
if hasMemory(500*1024) then open stack "Explore Multimedia"

Additional Comments
Expander triangle

Use the hasMemory function to check whether there's enough memory available for an action (such as displaying a large graphic) before you do it.

Parameters:

The bytes is the number of bytes you require. If the amount of available memory is greater than or equal to the bytes, the function returns true.

Comments:

This function is only partially implemented, and may not return useful values on some platforms. It is included in Revolution for compatibility with imported SuperCard projects.

Cross-platform note: On Mac OS systems, the valuereturned depends on the amount of free memory in the application heap and does not take available temporary memory into account. This means that even if the hasMemoryfunctionreturns false, there may be enough system memory available for the task, since Revolution uses temporary memory when necessary.

User Comments
Expander triangle