BB___CLS

=CLS= toc =MainWin Command=

Description
> This command clears the contents of the mainwin.

Syntax

 * 1) CLS

Example
code format="lb" 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 code

=Text Editor Method=

Description
> This command clears the contents of the text editor control or window.

Text Editor Control

 * 1) PRINT #Handle.Extension, "!CLS"
 * 2) #Handle.Extension "!CLS"

Text Editor Window

 * 1) PRINT #Handle, "!CLS"
 * 2) #Handle "!CLS"

Hints

 * 1) "!CLS" command resets modified flag to false

Text Editor Control
code format="lb" NOMAINWIN

TEXTEDITOR #m.te, 10, 10, 200, 200 OPEN "CLS - Test" FOR window AS #m
 * 1) m "trapclose [quit]"


 * 1) m.te "This will be cleared in 2 seconds"

' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished


 * 1) m.te "!CLS"

WAIT

[quit] CLOSE #m END code

Text Editor Window
code format="lb" NOMAINWIN

OPEN "CLS - Test" FOR text AS #m
 * 1) m "!trapclose [quit]"


 * 1) m "This will be cleared in 2 seconds"

' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished


 * 1) m "!CLS"

WAIT

[quit] CLOSE #m END code

toc =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.

Graphics Box

 * 1) PRINT #Handle.Extension, "CLS"
 * 2) #Handle.Extension "CLS"

Graphics Window

 * 1) PRINT #Handle, "CLS"
 * 2) #Handle "CLS"

Hints
> 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.
 * 1) "Flush" remembers graphic commands after last CLS.

Graphicbox Control
code format="lb" NOMAINWIN

GRAPHICBOX #m.gbx, 10, 10, 240, 200 OPEN "CLS - Test" FOR window AS #m
 * 1) m "trapclose [quit]"
 * 2) m.gbx "DOWN"
 * 3) m.gbx "\\This will be cleared in 2 seconds"
 * 4) m.gbx "flush"

' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished


 * 1) m.gbx "CLS"

WAIT

[quit] CLOSE #m END code

Graphics Window
code format="lb" NOMAINWIN

OPEN "CLS - Test" FOR graphics AS #m
 * 1) m "trapclose [quit]"
 * 2) m "DOWN"
 * 3) m "\\This will be cleared in 2 seconds"
 * 4) m "flush"

' start waiting two seconds TIMER 2000, [continue] WAIT [continue] TIMER 0 ' pause finished


 * 1) m "CLS"

WAIT

[quit] CLOSE #m END code