(self)
return None
Read a line or jump number, return as int.
Read a line or jump number, return as int.
Read a line or jump number return as int .
def read_line_number(self):
        """Read a line or jump number, return as int."""
        word = bytearray()
        ndigits, nblanks = 0, 0
        # don't read more than 5 digits
        while (ndigits < 5):
            c = self.peek()
            if not c:
                break
            elif c in DIGITS:
                word += self.read(1)
                nblanks = 0
                ndigits += 1
                if int(word) > 6552:
                    # note: anything >= 65530 is illegal in GW-BASIC
                    # in loading an ASCII file, GWBASIC would interpret these as
                    # '6553 1' etcetera, generating a syntax error on load.
                    break
            elif c in self.blanks:
                self.read(1)
                nblanks += 1
            else:
                break
        # don't claim trailing w/s
        self.seek(-nblanks, 1)
        if word:
            return int(word)
        return None
def read_line_number ( self ) : word = bytearray ( ) ndigits , nblanks = 0 , 0 # don't read more than 5 digits while ( ndigits < 5 ) : c = self . peek ( ) if not c : break elif c in DIGITS : word += self . read ( 1 ) nblanks = 0 ndigits += 1 if int ( word ) > 6552 : # note: anything >= 65530 is illegal in GW-BASIC # in loading an ASCII file, GWBASIC would interpret these as # '6553 1' etcetera, generating a syntax error on load. break elif c in self . blanks : self . read ( 1 ) nblanks += 1 else : break # don't claim trailing w/s self . seek ( - nblanks , 1 ) if word : return int ( word ) return None