MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / __fseekstmt

Method __fseekstmt

PyBasic/basicparser.py:726–749  ·  view source on GitHub ↗

Parses an fseek statement, seeks the indicated file position

(self)

Source from the content-addressed store, hash-verified

724 self.__file_handles.pop(filenum)
725
726 def __fseekstmt(self):
727 """Parses an fseek statement, seeks the indicated file position
728
729 """
730
731 self.__advance() # Advance past FSEEK token
732
733 # Process the # keyword
734 self.__consume(Token.HASH)
735
736 # Acquire the file number
737 self.__expr()
738 filenum = self.__operand_stack.pop()
739
740 if self.__file_handles.get(filenum) == None:
741 raise RuntimeError("FSEEK: file #"+str(filenum)+" not opened in line " + str(self.__line_number))
742
743 # Process the comma
744 self.__consume(Token.COMMA)
745
746 # Acquire the file position
747 self.__expr()
748
749 self.__file_handles[filenum].seek(self.__operand_stack.pop())
750
751 def __inputstmt(self):
752 """Parses an input statement, extracts the input

Callers 1

__simplestmtMethod · 0.95

Calls 4

__advanceMethod · 0.95
__consumeMethod · 0.95
__exprMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected