in BASIC ROM:
|List of all BASIC keywords|
Type: Command General Programming-Syntax: CLR
The BASIC-Command CLR deletes all variables, arrays, data read in from data-lines, defined functions, return addresses of subroutines (see GOSUB) and variables of loops (see FOR and NEXT) by releasing the RAM previously allocated for those. Furthermore opened files of both diskette and datasette are gone, because the cache is also deleted.
10 A=64 : B$="COMMODORE" : C%=128 20 PRINT B$ A "AND " B$ C% ; FRE(0)+65536 30 CLR 40 PRINT : PRINT B$ A "AND " B$ C% ; FRE(0)+65536
0 POKE56,52:CLR:REM make some free space after the BASIC program area for sprite shapes, character shapes etc. 10 A$="":REM the above usage of CLR command MUST precede first variable use 20 POKE13312,8:REM this would be dangerous if BASIC program area was not limited in line 0 or CLR was omitted - program code would be overwritten