Instructions/call

From Desynced Wiki
Revision as of 20:07, 19 October 2024 by Jythier (talk | contribs) (→‎Description)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


call
     File:Instructions-call.png
Lua ID call
Category Flow
Icon icon_input

Call a subroutine

Lua ID call
Category Flow
Icon icon_input



Description

This instruction is effectively a subroutine. As you add parameters to the subroutine, it will expand with multiple inputs, 1 per parameter in your subroutine. These parameters work by reference, so if you change the parameter in the subroutine, it will return a value to the calling routine in that same parameter or variable you used in the call function. This allows you to pass parameters back and forth between the two programs.

Uses

Optimal usage tends to be breaking code down into more repeatable sections in cases where you would use the same string of instructions multiple times.


Similar Instructions

Notes

Any unused sub-behaviors that aren't called by a call instruction get trimmed out of the behavior.