Coroutine.wrap

From ComputerCraft Wiki
Revision as of 17:25, 13 November 2012 by MathManiac0 (Talk | contribs) (Created Page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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!