Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>allofree()*</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ALLOFREE()*
 Determines the maximum memory size allocation
------------------------------------------------------------------------------
 Syntax

     ALLOFREE([<lMode>]) --> nFreeMemory

     *  This has been retained in CA-Clipper for compatibility purposes.
        Use the CA-Clipper MEMORY() function to develop future
        applications.

 Argument

     <lMode>  If passed as .T., the total available memory size is
     returned.  The default value is the largest contiguous block (.F.).

 Returns

     ALLOFREE() returns the maximum possible size for a contiguous memory
     block or the total amount of free memory available.

 Description

     Use this function to help avoid "memory fault" error messages.  You can
     implement it in conjunction with other functions that use a string area
     as a buffer (as when you read files).

 Note

     .  If there is not enough room on the stack, ALLOFREE(.T.)
        returns a value of -1.

 Examples

     .  This is what can happen if you try to print a maximum-length
        string without enough free memory:

        Var  :=  SPACE(65520)

     .  Make a string of the maximum-length possible:

        Var  := SPACE(ALLOFREE())           // Under no circumstances
                                            // call with .T.!
        ? LEN(Var)                          // How long has it become?

     .  Read in a file...

        FILESTR("Bigfile", ALLOFREE())      // The largest possible buffer

     .  Entire available memory:

        ? ALLOFREE(.T.)                     // Available memory


See Also: STACKFREE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson