Call (returns): Difference between revisions
(Marked this version for translation) |
(updates from Blockument) |
||
Line 3: | Line 3: | ||
<!--T:1--> | <!--T:1--> | ||
<section begin=image/>[[File:Call_(returns).png|alt=The Call (returns) Block|thumb]]<section end=image/><p id="tooltip">Calls a procedure that returns a value. | <section begin=image/>[[File:Call_(returns).png|alt=The Call (returns) Block|thumb]]<section end=image/><p id="tooltip">The value that is returned when this specified procedure is called.</p> | ||
==Usage== | |||
Calls a procedure that returns a value. | |||
==Syntax== | |||
Inputs in this block: | |||
#a created procedure that returns a numerical value from the dropdown menu | |||
==Example== | |||
[[File:call_(returns)_example.gif|alt=Call (returns) example gif|thumb]] | |||
[[File:call_(returns)_example.png|alt=Call (returns) example code|thumb]] | |||
In this model, a created [[Special:MyLanguage/Procedure|procedure]] calculates the distance of the “Turtle” agent from the center of spaceland using the pythagorean theorem. Whenever the calculate distance button is pushed, the [[Special:MyLanguage/Procedure|procedure]] ‘Calculate Distance’ is called and the distance from the center is displayed in a data box. Note that this shape of the call block is used to retrieve the returned information from the [[Special:MyLanguage/Procedure|procedure]]. | |||
==Related Blocks== | |||
*[[Special:MyLanguage/Call|Call]] | |||
<!--T:2--> | <!--T:2--> |
Revision as of 18:52, 14 August 2023
The value that is returned when this specified procedure is called.
Usage
Calls a procedure that returns a value.
Syntax
Inputs in this block:
- a created procedure that returns a numerical value from the dropdown menu
Example
In this model, a created procedure calculates the distance of the “Turtle” agent from the center of spaceland using the pythagorean theorem. Whenever the calculate distance button is pushed, the procedure ‘Calculate Distance’ is called and the distance from the center is displayed in a data box. Note that this shape of the call block is used to retrieve the returned information from the procedure.