Garry's Mod Wiki

coroutine.yield

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!"

Special Pages


Wikis

?

Render Time: 90ms

DB GetPage 42
Generate Html 6
SaveChanges (1) 31
Render Body 0
Render Sidebar 8