Difference between revisions of "X file:lines"
From GiderosMobile
| Line 22: | Line 22: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | {{File}} | + | {{X File}} |
Latest revision as of 22:39, 24 January 2026
Available since: Gideros 2011.6
Class: X File
Description
Returns an iterator function that, each time it is called, returns a new line from the file.
(function) = file:lines()
Unlike io.lines, this function does not close the file when the loop ends.
Return values
Returns (function) iterator function
Example
To iterate over all lines of a file
for line in file:lines() do
--body
end