File:Lines: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
<languages />
=== Description ===
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
Returns an iterator function that, each time it is called, returns a new line from the file. Therefore, the construction  
'''<translate>Class</translate>:''' [[Special:MyLanguage/file|file]]<br/>
=== <translate>Description</translate> ===
<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`
     ''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>
'''Returns''' (function) iterator function<br/>
=== <translate>Return values</translate> ===
'''<translate>Returns</translate>''' (function) <translate>iterator function</translate><br/>

Latest revision as of 08:58, 3 September 2018


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

There are no pages that use this file.