17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

CLEAR Command<br />

Purpose:<br />

To set all numeric variables to zero, all string variables to null, and to close all open files. Options<br />

set the end of memory and reserve the amount of string and stack space available for use by GW-<br />

BASIC.<br />

Syntax:<br />

CLEAR[,[expression1][,expression2]]<br />

Comments:<br />

expression1 is a memory location that, if specified, sets the maximum number of bytes<br />

available for use by GW-BASIC.<br />

expression2 sets aside stack space for GW-BASIC. The default is the previous stack space<br />

size. When GW-BASIC is first executed, the stack space is set to 512 bytes, or one-eighth of the<br />

available memory, whichever is smaller. GW-BASIC allocates string space dynamically. An<br />

"Out of String Space" error occurs only if there is no free memory left for GW-BASIC to<br />

use.<br />

The CLEAR command:<br />

● Closes all files<br />

● Clears all COMMON and user variables<br />

● Resets the stack and string space<br />

● Releases all disk buffers<br />

● Turns off any sound<br />

● Resets sound to music foreground<br />

● Resets PEN to off<br />

● Resets STRIG to off<br />

● Disables ON ERROR trapping<br />

Examples:<br />

CLEAR<br />

Zeroes variables and nulls all strings.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/CLEAR.html (1 of 2)28/03/2004 21.29.18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!