Difference between revisions of "Io.input"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[io]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/io|io]]<br/>
 
=== <translate>Description</translate> ===
 
<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.
 
  
 +
=== Description ===
 +
When called with a file name, it opens the named file (in text mode), and sets its handle as the default input file.
  
In case of errors this function raises the error, instead of returning an error code.</translate>
+
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.
 
<source lang="lua">
 
<source lang="lua">
 
(file) = io.input(file)
 
(file) = io.input(file)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''file''': (file) <translate>file object to use as default input</translate> '''optional'''<br/>
+
'''In case of errors this function raises the error, instead of returning an error code.'''
=== <translate>Return values</translate> ===
+
 
'''<translate>Returns</translate>''' (file) <translate>default input file object</translate><br/>
+
=== Parameters ===
 +
'''file''': (file) file object to use as default input '''optional'''<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (file) default input file object<br/>
  
 
{{Io}}
 
{{Io}}

Revision as of 06:12, 7 December 2020

Available since: Gideros 2011.6
Class: io

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.

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

Parameters

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

Return values

Returns (file) default input file object