Io.output: Difference between revisions
From GiderosMobile
No edit summary |
m Text replacement - "</source>" to "</syntaxhighlight>" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 9: | Line 9: | ||
When called without parameters, it returns the current default output file. | When called without parameters, it returns the current default output file. | ||
< | <syntaxhighlight lang="lua"> | ||
(file) = io.output(file) | (file) = io.output(file) | ||
</ | </syntaxhighlight> | ||
'''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.''' | ||
Latest revision as of 13: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