Difference between revisions of "Io.type"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(2 intermediate revisions by 2 users not shown)
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> ===
+
=== Description ===
<translate>Checks whether obj is a valid file handle. Returns the string "file" if obj is an open file handle, "closed file" if obj is a closed file handle, or nil if obj is not a file handle.</translate>
+
Checks whether '''obj''' is a valid file handle.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = io.type(obj)
 
(string) = io.type(obj)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''obj''': (any) <translate>object to test</translate> <br/>
+
Returns the string:
=== <translate>Return values</translate> ===
+
*'''"file"''' if obj is an open file handle
'''<translate>Returns</translate>''' (string) <translate>string representing the state of the object or nil if not file handler</translate><br/>
+
*'''"closed file"''' if obj is a closed file handle
 +
*'''nil''' if obj is not a file handle
 +
 
 +
=== Parameters ===
 +
'''obj''': (any) object to test<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (string) string representing the state of the object or nil if not file handler<br/>
  
 
{{Io}}
 
{{Io}}

Latest revision as of 14:31, 13 July 2023

Available since: Gideros 2011.6
Class: io

Description

Checks whether obj is a valid file handle.

(string) = io.type(obj)

Returns the string:

  • "file" if obj is an open file handle
  • "closed file" if obj is a closed file handle
  • nil if obj is not a file handle

Parameters

obj: (any) object to test

Return values

Returns (string) string representing the state of the object or nil if not file handler