Difference between revisions of "Coroutine.status"

From GiderosMobile
Line 3: Line 3:
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/coroutine|coroutine]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/coroutine|coroutine]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate>Returns the status of `coroutine` co, as a string: "running", if the coroutine is running (that is, it called status); "suspended", if the coroutine is suspended in a call to yield, or if it has not started running yet; "normal" if the coroutine is active but not running (that is, it has resumed another coroutine); and "dead" if the coroutine has finished its body function, or if it has stopped with an error.</translate>
+
<translate>Returns the status of [[Special:MyLanguage/coroutine|coroutine]] co, as a string: "running", if the coroutine is running (that is, it called status); "suspended", if the coroutine is suspended in a call to yield, or if it has not started running yet; "normal" if the coroutine is active but not running (that is, it has resumed another coroutine); and "dead" if the coroutine has finished its body function, or if it has stopped with an error.</translate>
 
<source lang="lua">
 
<source lang="lua">
 
(string) = coroutine.status(co)
 
(string) = coroutine.status(co)

Revision as of 09:35, 24 August 2018

Available since: Gideros 2011.6
Class: coroutine

Description

Returns the status of coroutine co, as a string: "running", if the coroutine is running (that is, it called status); "suspended", if the coroutine is suspended in a call to yield, or if it has not started running yet; "normal" if the coroutine is active but not running (that is, it has resumed another coroutine); and "dead" if the coroutine has finished its body function, or if it has stopped with an error.

(string) = coroutine.status(co)

Parameters

co: (coroutine) coroutine to check status for

Return values

Returns (string) the state of coroutine