Difference between revisions of "Io.input"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
When called with a file name, it opens the named file (in text mode), and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. When called without parameters, it returns the current default input file.  
+
<translate>When called with a file name, it opens the named file (in text mode), and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. When called without parameters, it returns the current default input file.  
  
  
  In case of errors this function raises the error, instead of returning an error code.
+
  In case of errors this function raises the error, instead of returning an error code.</translate>
 
<source lang="lua">
 
<source lang="lua">
 
(file) = io.input(file)
 
(file) = io.input(file)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''file''': (file) file object to use as default input '''optional'''<br/>
+
'''file''': (file) <translate>file object to use as default input</translate> '''optional'''<br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (file) default input file object<br/>
+
'''Returns''' (file) <translate>default input file object</translate><br/>

Revision as of 14:33, 23 August 2018

Available since: Gideros 2011.6

Description

When called with a file name, it opens the named file (in text mode), and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. When called without parameters, it returns the current default input file.


In case of errors this function raises the error, instead of returning an error code.
(file) = io.input(file)

Parameters

file: (file) file object to use as default input optional

Return values

Returns (file) default input file object