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

17 lines
369 B
Text

f = freefile
filename$ = "input.txt"
open f, filename$
lineapedida = 7
cont = 0
while not (eof(f))
linea$ = readline(f)
cont += 1
if cont = lineapedida then
if trim(linea$) = "" then print "The 7th line is empty" else print linea$
exit while
end if
end while
if cont < lineapedida then print "There are only "; cont; " lines in the file"
close f
end