Difference between revisions of "Coroutine.create"
From ComputerCraft Wiki
(Remove example that doesn’t show anything interesting on its own, improve description, and use type template) |
|||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=coroutine.create | |name=coroutine.create | ||
− | |args= | + | |args={{Type|function}} f |
|api=Coroutine | |api=Coroutine | ||
− | |returns= | + | |returns={{Type|coroutine}} the new coroutine |
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Creates a new coroutine | + | |desc=Creates a new coroutine. When the new coroutine is resumed for the first time, it will begin by invoking <var>f</var>. When <var>f</var> returns, the coroutine will become dead. |
− | |examples= | + | |examples=Please see [[Coroutine (API)]] for a worked example of using all the coroutine functions. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Latest revision as of 18:24, 22 April 2013
Function coroutine.create | |
Creates a new coroutine. When the new coroutine is resumed for the first time, it will begin by invoking f. When f returns, the coroutine will become dead. | |
Syntax | coroutine.create(function f) |
Returns | coroutine the new coroutine |
Part of | ComputerCraft |
API | Coroutine |
Examples
Please see Coroutine (API) for a worked example of using all the coroutine functions.