(self, new_runmode, pos=None)
Set program pointer to the given codestream and position.
Set program pointer to the given codestream and position.
Set program pointer to the given codestream and position .
def set_pointer(self, new_runmode, pos=None):
        """Set program pointer to the given codestream and position."""
        # flush lpt1 on entering interactive mode
        if self.run_mode and not new_runmode:
            self._files.lpt1_file.do_print()
        self.run_mode = new_runmode
        # events are active in run mode
        self._basic_events.set_active(new_runmode)
        # keep the sound engine on to avoid delays in run mode
        self._sound.persist(new_runmode)
        # suppress cassette messages in run mode
        self._files.get_device(b'CAS1:').quiet(new_runmode)
        codestream = self.get_codestream()
        if pos is not None:
            # jump to position, if given
            codestream.seek(pos)
        else:
            # position at end - don't execute anything unless we jump
            codestream.seek(0, 2)
def set_pointer ( self , new_runmode , pos = None ) : # flush lpt1 on entering interactive mode if self . run_mode and not new_runmode : self . _files . lpt1_file . do_print ( ) self . run_mode = new_runmode # events are active in run mode self . _basic_events . set_active ( new_runmode ) # keep the sound engine on to avoid delays in run mode self . _sound . persist ( new_runmode ) # suppress cassette messages in run mode self . _files . get_device ( b'CAS1:' ) . quiet ( new_runmode ) codestream = self . get_codestream ( ) if pos is not None : # jump to position, if given codestream . seek ( pos ) else : # position at end - don't execute anything unless we jump codestream . seek ( 0 , 2 )