FRE

Function

FRE returns the number of free bytes left in execution memory (R0).

Syntax

FRE(O)

0 is a dummy argument.

Examples

PRINT FRE(0)

displays amount of free space in execution memory, or

A=FRE(0)

Sets A = amount of free space.

Remarks

Note that if a program has not been RUN then the variables will not have been assigned space. This enables easy display of program size and, after RUNing, the total memory usage.

The latter examples allows the AUTO SIZING of arrays to their maximum size.

e.g.

DIM A((FRE(0)-10240)/5)

This autosizes A leaving 10K (10240 byte) for other variables. “5” is the number of bytes used for each member of A. Remember to leave enough space for all simple variables.