Coroutine.wrap

From ComputerCraft Wiki
Revision as of 18:46, 28 November 2012 by AfterLifeLochie (Talk | contribs) (Moved to CAT:LuaCoreFunctions)

Jump to: navigation, search
Grid Redstone.png  Function coroutine.wrap
Creates and Returns a Coroutine in the form of a function.
Syntax coroutine.wrap(function)
Returns function coroutine
Part of ComputerCraft
API Coroutine

Examples

Grid paper.png  Example
Runs a created coroutine.
Code
local func = coroutine.wrap(print)
func("Hello World!")
Output Hello World!