CT_ALLOFREE

 ALLOFREE()*
 Determines the maximum memory size allocation
------------------------------------------------------------------------------
 Syntax

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

     *  This has been retained in Clipper for compatibility purposes.
        Use the 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()



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.