RosettaCodeData/Task/Read-a-specific-line-from-a-file/BBC-BASIC/read-a-specific-line-from-a-file.basic
2023-07-01 13:44:08 -04:00

13 lines
371 B
Text

filepath$ = @lib$ + "..\licence.txt"
requiredline% = 7
file% = OPENIN(filepath$)
IF file%=0 ERROR 100, "File could not be opened"
FOR i% = 1 TO requiredline%
IF EOF#file% ERROR 100, "File contains too few lines"
INPUT #file%, text$
NEXT
CLOSE #file%
IF ASCtext$=10 text$ = MID$(text$,2)
PRINT text$