HTBasic Help
×
Menu
Index

FRE

Returns the amount of free memory.
 
 FRE
 
Usage:
Remaining=FRE-Needed
IF FRE<Wanted then CALL Wolf
 
Example:           FRE.BAS
 
Description:
This function returns the amount of available memory. To quickly see how much memory is available, type FRE and press ENTER. The value will be printed on the message line. This is the same value printed at the end of a LIST statement or returned by the SYSTEM$("AVAILABLE MEMORY") function.
 
Command Line Switch
The amount of available memory to give HTBasic when it starts is set with a command line switch. The -w (workspace) switch specifies how much memory to set aside for your programs and data. The syntax is
 
-w amount[k|m]
 
where amount should be replaced with a number specifying the amount of memory. Amount can optionally be followed by a "k" or an "m". If no "k" or "m" is given, the number specifies bytes. If "k" is given, the number specifies kilobytes and if "m" is given, the number specifies megabytes.
 
The default workspace size is sixteen megabytes. Note that the amount of free memory reported can be somewhat less than that requested because device drivers or other memory users may allocate some of the memory during startup.
 
The following example allocates thirty-two megabytes:
 
-w 32M
 
BackPorting
to HP BASIC:
FRE is a new HTBasic function that is not available in HP BASIC. It should not be used in programs that must be ported back to HP BASIC.
 
See Also: