Garry's Mod Wiki

coroutine.yield

vararg coroutine.yield( vararg returnValue )

Description

Pauses the active coroutine and passes all additional variables to the call of coroutine.resume that resumed the coroutine last time, and returns all additional variables that were passed to the previous call of resume.

Arguments

1 vararg returnValue
Arguments to be returned by the last call of coroutine.resume

Returns

1 vararg
Arguments that were set previously by coroutine.resume

Example

Demonstrates the use of using varargs as a return value.

local co = coroutine.create( function() coroutine.yield( "Hello world!" ) end ) print( coroutine.resume( co ) )
Output: true, "Hello world!"

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 2
Generate Html 12
SaveChanges (1) 13
Render Body 0
Render Sidebar 10