FANDOM


yield( )

Yields control back to the caller from within a coroutine.

A coroutine is a special kind of function that can yield control back to the caller without completely exiting. The caller can then resume the coroutine as many times as needed until the function exits.

The coroutine calls yield() to suspend the coroutine and return control back to the caller in this way. It does not accept any values. (Lua and other languages support yielding and returning values from coroutines, but Pico-8 does not.)

yield() returns all extra arguments passed to the coresume() that resumed it.

To terminate the coroutine, the function returns with the return statement. After this point, the coroutine is considered dead and cannot be resumed.

Examples Edit

See cocreate() and coresume() for examples.

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.