Skip to main content

Return Early

Used in a procedure definition to end a procedure early with the option of returning a value.

Return Early block

Description

The Return Early block is used in a procedure definition to end a procedure early with the option of returning a value. This is a code block part of the Procedures drawer.

Usage

Used in a procedure definition to end a procedure early with the option of returning a value.

Syntax

Inputs in this block:

  • Optional: a value to return (if the procedure returns a value)

Example

The Return Early block is useful when you want to exit a procedure before reaching its end, often used in conditional statements to return different values based on certain conditions.

Notes

Return Early allows for more complex control flow within procedures, enabling you to exit at different points based on conditions or after completing necessary operations.

  • Procedure - Define a procedure that can use return early
  • Call (returns) - Call a procedure that may return early with a value
  • Parameter - Use parameters that might influence when to return early