11 - 74 11 - 74
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
FRE
Function
FREe
• Returns the size of the unused area of memory in bytes.
FRE ( <numeric expression> )
FRE ( <character string expression> )
numeric expression
• • • •
Specify an numeric constant or numeric value
variable as a dummy.
Syntax
character string expression
• • • •
Specify a character constant or character variable as
a dummy.
PRINT FRE(A)
• • • •
Displays the number of bytes that can be used by
the BASIC program.
Examples
PRINT FRE(“TEST”)
• • • •
Displays the number of bytes of the unused
character string processing area.
Description
• The FRE function returns the number of bytes of the unused area in the BASIC program
area when <numeric expression> is specified.
The unused area is the area that is not used as the program, area for processing the
character string, or as the variable area.
The value of <numeric expression> is a dummy and has no meaning.
• The size of the unused character string processing area is returned in bytes when
<character string expression> is specified.
The value of <character string expression> is a dummy and has no meaning.
• The value returned from the FRE function is not the unused area of the entire memory that
is used by multitask processing, but the unused area of the task number area where the
FRE function is executed.
• For the memory map, see the User’s Manual of each communication module used.
Program Example
10 ' Displays the size of the unused memory area
20 PRINT "Task No. area-->";ZBAS
:
' Displays the task No. area
30 PRINT "Unused area=";FRE(0);"byte"
:
' Displays the size of the unused area
50 END
RUN
Task No. area--> 1
Unused area= 4601 bytes
OK
REMARK
See the CLEAR and ERASE instructions.