Read a specific line from a file: Difference between revisions

Content added Content deleted
(Add Factor example)
mNo edit summary
Line 1,109: Line 1,109:


print iter!</lang>
print iter!</lang>

=={{header|Nanoquery}}==
<lang Nanoquery>def getline(fname, linenum)
contents = null
try
contents = new(Nanoquery.IO.File).read()
return contents[linenum]
catch
if contents = null
throw new(Exception, "unable to read from file '" + fname + "'")
else
throw new(Exception, "unable to retrieve line " + linenum + " from file: not enough lines")
end
end
end</lang>


=={{header|NetRexx}}==
=={{header|NetRexx}}==