Difference between revisions of "Io.output"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/io|io]]<br/>
+
'''Class:''' [[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 output file. When called with a file handle, it simply sets this file handle as the default output file. When called without parameters, it returns the current default output file.
 
  
 +
=== Description ===
 +
When called with a file name, it opens the named file (in text mode), and sets its handle as the default output 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 output file.
<source lang="lua">
+
 
 +
When called without parameters, it returns the current default output file.
 +
<syntaxhighlight lang="lua">
 
(file) = io.output(file)
 
(file) = io.output(file)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''file''': (file) <translate>file object to use as default output</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 output file object</translate><br/>
+
=== Parameters ===
 +
'''file''': (file) file object to use as default output '''optional'''<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (file) default output file object<br/>
 +
 
 +
{{Io}}

Latest revision as of 15:30, 13 July 2023

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 output file.

When called with a file handle, it simply sets this file handle as the default output file.

When called without parameters, it returns the current default output file.

(file) = io.output(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 output optional

Return values

Returns (file) default output file object