1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 17:55:52 +00:00
QB64-PE/internal/help/CLEAR.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

37 lines
1.2 KiB
Plaintext

The ''CLEAR''' statement clears all variable and array element values in a program. It does not affect constant values!
''Syntax:'' CLEAR [, ''stacksize&amp;'' , ''stackspace&amp;'']
{{PageDescription}}
* Optional ''stacksize'' parameter was not required as Qbasic managed that. '''All three parameters are ignored by QB64!'''
* The ''stackspace'' parameter sets the stack space to be added to the stack. Two commas kept Qbasic compatible with BASICA.
* Normally used to clear all program variable and [[Arrays|array]] values where numerical values become zero and string values become null.
* It does not clear [[CONST|constant]] values.
* Closes all opened files also.
* [[$DYNAMIC]] arrays will need to be [[REDIM|re-dimensioned]] or an [[ERROR Codes|error]] will occur when referenced because the array is removed.
''Example:'' Using CLEAR to clear array elements.
{{CodeStart}} '' ''
{{Cl|CLS}}
{{Cl|DIM}} array(10) 'create a {{Cl|$STATIC}} array
array(5) = 23
{{Cl|PRINT}} array(5)
{{Cl|CLEAR}}
{{Cl|PRINT}} array(5) '' ''
{{CodeEnd}}
:''Note:'' If you change DIM to REDIM a &quot;Subscript out of range&quot; error will occur because a [[$DYNAMIC]] array is removed by CLEAR.
{{PageSeeAlso}}
* [[ERASE]]
* [[REDIM]]
* [[Arrays]]
{{PageNavigation}}