From QB64.org wiki
The CLEAR statement clears all variable and array element values in a program.
- CLEAR [, ignored& , ignored&]
- All parameters are optional and ignored by QB64.
- Normally used to clear all program variable and array values where numerical values become zero and string values become empty ("").
- It does not clear constant values.
- Closes all opened files.
- $DYNAMIC or REDIM arrays will need to be redimensioned or an error will occur when referenced because they are removed.
- Note: If you change DIM to REDIM a "Subscript out of range" error will occur because a $DYNAMIC array is removed by CLEAR.