| .CLEAR Statement Details. |
|
  QuickSCREEN       Details       Example       Contents       Index |
| ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ |
| Details |
|
| Syntax |
|   CLEAR [,,stack] |
|   |
| The CLEAR statement performs the following actions: |
|   |
|   ž Closes all files and releases the file buffers |
|   ž Clears all COMMON variables |
|   ž Sets numeric variables and arrays to zero |
|   ž Sets all string variables to null |
|   ž Reinitializes the stack and, optionally, changes its size |
|   |
| The stack parameter sets aside stack space for your program. |
| QuickBASIC takes the amount of stack space it requires, adds the |
| number of bytes specified by stack, and sets the stack size to the |
| result. |
|   |
|   Note: Two commas are used before stack to keep QuickBASIC compatible |
|         with BASICA. BASICA included an additional argument that set the |
|         size of the data segment. Because QuickBASIC automatically manages |
|         the data segment, the first parameter is no longer required. |
|   |
| If your program has deeply nested subroutines or procedures, or if |
| you use recursive procedures, you may want to use a CLEAR statement |
| to increase the stack size. You may also want to increase the stack |
| size if your procedures have a large number of arguments. |
|   |
| Clearing the stack destroys the return addresses placed on the stack |
| during the execution of a GOSUB. This makes it impossible to execute |
| a RETURN statement correctly and produces a "RETURN without GOSUB" |
| run-time error message. Using a CLEAR statement in a SUB or FUNCTION |
| produces a run-time error message that reads "Illegal function call." |
|   |
| Differences from BASICA |
|   |
| BASICA programs using CLEAR may require modification. In BASICA |
| programs, any DEF FN functions or data types declared with DEFtype |
| statements are lost after a CLEAR statement. In compiled programs, |
| this information is not lost because these declarations are fixed at |
| compile time. |