[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson