Difference between revisions of "Coroutine.resume"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''<translate>Available since</translate>:''' Gideros 2011.6<br/> | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | ||
+ | '''<translate>Class</translate>:''' [[Special:MyLanguage/coroutine|coroutine]]<br/> | ||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
<translate>Starts or continues the execution of coroutine co. The first time you resume a coroutine, it starts running its body. The values val1, ··· are passed as the arguments to the body function. If the coroutine has yielded, resume restarts it; the values val1, ··· are passed as the results from the yield. | <translate>Starts or continues the execution of coroutine co. The first time you resume a coroutine, it starts running its body. The values val1, ··· are passed as the arguments to the body function. If the coroutine has yielded, resume restarts it; the values val1, ··· are passed as the results from the yield. |
Revision as of 09:27, 24 August 2018
Available since: Gideros 2011.6
Class: coroutine
Description
Starts or continues the execution of coroutine co. The first time you resume a coroutine, it starts running its body. The values val1, ··· are passed as the arguments to the body function. If the coroutine has yielded, resume restarts it; the values val1, ··· are passed as the results from the yield.
If the coroutine runs without any errors, resume returns true plus any values passed to yield (if the coroutine yields) or any values returned by the body function (if the coroutine terminates). If there is any error, resume returns false plus the error message.
(bool), (multiple) = coroutine.resume(co,val1,...)
Parameters
co: (coroutine) coroutine to start or resume
val1: (any) value to pass as the result optional
...: (any) other optional values to pass as results optional
Return values
Returns (bool) true if coroutine ran without errors, false otherwise
Returns (multiple) values provided to coroutine.yield function call