Skip to main content

Yield

Works as a pause in the current stack of code for 1 tick.

Yield block

Description

The Yield block works as a pause in the current stack of code for 1 tick. This is a code block from the Logic drawer.

Usage

Works as a pause in the current stack of code for 1 tick.

Syntax

This block has no inputs.

Example

Yield can be used to complete tasks sequentially. In this example, when 'celebrate' is pushed we see that after each yield block a new forward step is taken. This shows that the yield block pauses the current set of instructions for one tick of the StarLogo Nova clock.

Yield example code
  • Repeat Times - Repeats a specific number of times
  • While - Repeats while a condition is true