(self, args)
CLS: clear the screen.
CLS: clear the screen.
CLS : clear the screen .
def cls_(self, args):
        """CLS: clear the screen."""
        val = next(args)
        if val is not None:
            val = values.to_int(val)
            # tandy gives illegal function call on CLS number
            error.throw_if(self._adapter == 'tandy')
            error.range_check(0, 2, val)
        list(args)
        # CLS is only executed if no errors have occurred
        if not self.mode.is_text_mode and (
                val == 1 or (val is None and self.graphics.graph_view.active)
            ):
            # CLS 1: in graphics mode, clear the graphics viewport
            _, back, _, _ = self.colourmap.split_attr(self.attr)
            self.graphics.graph_view[:, :] = back
            self.graphics.reset()
            if not self.graphics.graph_view.active:
                self.text_screen.redraw_bar()
                self.text_screen.set_pos(1, 1)
        elif val == 0 or (val is None and not self.text_screen.scroll_area.active):
            self.text_screen.clear()
            self.text_screen.redraw_bar()
            self.graphics.reset()
        elif val == 2:
            # CLS 2 does not reset the graphics pointer (checked with DOSBox)
            # if vscroll area is not active, this does not clear the bottom bar
            self.text_screen.clear_view()
        elif val is None:
            # however, CLS only with active scroll area *does* reset the view
            # clear_view will clear the whole screen if the view is not set
            self.text_screen.clear_view()
            self.graphics.reset()
def cls_ ( self , args ) : val = next ( args ) if val is not None : val = values . to_int ( val ) # tandy gives illegal function call on CLS number error . throw_if ( self . _adapter == 'tandy' ) error . range_check ( 0 , 2 , val ) list ( args ) # CLS is only executed if no errors have occurred if not self . mode . is_text_mode and ( val == 1 or ( val is None and self . graphics . graph_view . active ) ) : # CLS 1: in graphics mode, clear the graphics viewport _ , back , _ , _ = self . colourmap . split_attr ( self . attr ) self . graphics . graph_view [ : , : ] = back self . graphics . reset ( ) if not self . graphics . graph_view . active : self . text_screen . redraw_bar ( ) self . text_screen . set_pos ( 1 , 1 ) elif val == 0 or ( val is None and not self . text_screen . scroll_area . active ) : self . text_screen . clear ( ) self . text_screen . redraw_bar ( ) self . graphics . reset ( ) elif val == 2 : # CLS 2 does not reset the graphics pointer (checked with DOSBox) # if vscroll area is not active, this does not clear the bottom bar self . text_screen . clear_view ( ) elif val is None : # however, CLS only with active scroll area *does* reset the view # clear_view will clear the whole screen if the view is not set self . text_screen . clear_view ( ) self . graphics . reset ( )