CLS
Jump to navigation
Jump to search
MainWin Command
Description
- This command clears the contents of the mainwin.
Syntax
- CLS
Example
Print "This text will be erased with the cls command," Print "you will not see it." Print Print "If you like to see it vanish," Print "step through the code using the debugger." CLS
Text Editor Method
Description
- This command clears the contents of the text editor control or window.
Syntax
Text Editor Control
- PRINT #Handle.Extension, "!CLS"
- #Handle.Extension "!CLS"
Text Editor Window
- PRINT #Handle, "!CLS"
- #Handle "!CLS"
Hints
- "!CLS" command resets the modified flag to false
Example
Text Editor Control
NOMAINWIN TEXTEDITOR #m.te, 10, 10, 200, 200 OPEN "CLS - Test" FOR window AS #m #m "trapclose [quit]" #m.te "This will be cleared in 2 seconds" ' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished #m.te "!CLS" WAIT [quit] CLOSE #m END
Text Editor Window
NOMAINWIN OPEN "CLS - Test" FOR text AS #m #m "!trapclose [quit]" #m "This will be cleared in 2 seconds" ' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished #m "!CLS" WAIT [quit] CLOSE #m END
Graphics Method
Description
- This command clears the contents of the graphics control or window.
- In addition, it frees all the used memory of the graphics control or window.
- Only graphic commands after last CLS will "stick" after "FLUSH" command.
Syntax
Graphics Box
- PRINT #Handle.Extension, "CLS"
- #Handle.Extension "CLS"
Graphics Window
- PRINT #Handle, "CLS"
- #Handle "CLS"
Hints
- "Flush" remembers graphic commands after last CLS.
- If you changed pen size or color, did CLS, then draw and FLUSH, state of pen before CLS is not remebered.
- So your picture could change.
Example
Graphicbox Control
NOMAINWIN GRAPHICBOX #m.gbx, 10, 10, 240, 200 OPEN "CLS - Test" FOR window AS #m #m "trapclose [quit]" #m.gbx "DOWN" #m.gbx "\\This will be cleared in 2 seconds" #m.gbx "flush" ' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished #m.gbx "CLS" WAIT [quit] CLOSE #m END
Graphics Window
NOMAINWIN OPEN "CLS - Test" FOR graphics AS #m #m "trapclose [quit]" #m "DOWN" #m "\\This will be cleared in 2 seconds" #m "flush" ' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished #m "CLS" WAIT [quit] CLOSE #m END