LuaNET, the lua 5.1 api documentation!

Lua-Api

Input/Output

[LUA 5.1] file:lines

function file:lines (  )
Returns an iterator function that, each time it is called, returns a new line from the file.

Therefore, the construction

Code
for line in file:lines() do {body} end

will iterate over all lines of the file.
(Unlike io.lines, this function does not close the file when the loop ends.)

Comments

© 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.225 seconds with 19 queries.