X file:lines

From GiderosMobile
Revision as of 21:43, 11 February 2020 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ <languages /> '''<translate>Available since</translate>:''' Gideros 2011.6<br/> '''<translate>Class</translate>:''' file<br/> === <transl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Available since: Gideros 2011.6
Class: file

Description

Returns an iterator function that, each time it is called, returns a new line from the file. Therefore, the construction

    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.)
(function) = file:lines()

Return values

Returns (function) iterator function