Difference between revisions of "Coroutine.create"

From ComputerCraft Wiki
Jump to: navigation, search
(THIS IS NOT JAVA)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=coroutine.create
 
|name=coroutine.create
|args=[[Function (type)|function]]
+
|args=[[Function (type)|function]] function
 
|api=Coroutine
 
|api=Coroutine
|returns=[[coroutine]]
+
|returns=[[coroutine]] new coroutine
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Creates a new coroutine
 
|desc=Creates a new coroutine
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=creates a coroutine.
 
|desc=creates a coroutine.
|code=func = coroutine.create(function() print("Hello World") end) func()
+
|code=coroutine.create(function() print("Hello World") end)
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 12:17, 4 December 2012


Grid Redstone.png  Function coroutine.create
Creates a new coroutine
Syntax coroutine.create(function function)
Returns coroutine new coroutine
Part of ComputerCraft
API Coroutine

Examples

Grid paper.png  Example
creates a coroutine.
Code
coroutine.create(function() print("Hello World") end)