qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
FRE Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Returns the amount (in bytes) of available or unused memory.
 
FRE(numeric-expression)
FRE(stringexpression$)
 
    ■ numeric-expression    A value that specifies the type of memory:
 
                            Value               FRE returns
                            ════════════════    ═════════════════════════════
                            -1                  The size of the largest array
                                                (nonstring) you can create
                            -2                  The unused stack space
                            Any other number    The available string space
 
    ■ stringexpression$     Any string expression. FRE compacts the free
                            string space into a single block, then returns
                            the amount of available string space.
 
Example:
    PRINT "String Space", FRE("")
    PRINT "Unused Stack Space", FRE(-2)
    PRINT "Array Space", FRE(-1)