FRE()
This page was last modified 01:27, 6 December 2016 by Mars2000you. Based on work by Gdx and NYYRIKKI and others.

Contents

Effect

- Returns the amount of bytes in memory which can be used for BASIC programs, variables, etc... if the parameter is a numeric value.
- Returns the amount of bytes in memory which can be used for strings If the parameter is a string.

Syntax

  • FRE(<value>)
  • FRE("<string>")

Parameters

<value> can be any value or a numeric variable.

<string> can be any string (in quotation marks) or an alphanumeric variable.

Examples

Get free memory for your Basic program:

10 PRINT "First there are ";FRE(0);" bytes free"
20 DIMB(100)
30 PRINT "Now there are ";FRE(0);" bytes free"
 
RUN
First there are 23332 bytes free
Now there are 22516 bytes free


Get free memory for strings in your Basic program:

PRINT FRE("");
200
Ok
a$="MSX"
PRINT FRE("");
197
Ok

Related to

CLEAR, ERASE, NEW

Compatibility

MSX-BASIC 1.0 or higher