File:Lines: Difference between revisions
From GiderosMobile
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
=== Description === | === Description === | ||
Returns an iterator function that, each time it is called, returns a new line from the file. Therefore, the construction | <translate>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.) | will iterate over all lines of the file. (Unlike io.lines, this function does not close the file when the loop ends.)</translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
(function) = file:lines() | (function) = file:lines() | ||
</source> | </source> | ||
=== Return values === | === Return values === | ||
'''Returns''' (function) iterator function<br/> | '''Returns''' (function) <translate>iterator function</translate><br/> | ||
Revision as of 12:33, 23 August 2018
Available since: Gideros 2011.6
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
File usage
There are no pages that use this file.