While Toggled/es: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(Updating to match new version of source page)
 
(4 intermediate revisions by 2 users not shown)
Line 5: Line 5:
<section end="image"/>
<section end="image"/>
<section begin="name" />{{Block|while [▼] toggled}}<section end="name" /> is a code block from the [[Special:MyLanguage/Interface|interfaz]] drawer.
<section begin="name" />{{Block|while [▼] toggled}}<section end="name" /> is a code block from the [[Special:MyLanguage/Interface|interfaz]] drawer.
<div lang="en" dir="ltr" class="mw-content-ltr">
<section begin="name" />{{Block|while [▼] toggled}}<section end="name" /> is a code block from the [[Interface]] drawer.
</div>


==Usage==
==Usage==
<p id="tooltip">{{Block|while [▼] toggled}} executes commands repeatedly while the toggle button widget is turned on. When the toggle button widget is turned off, the commands in this block don’t run. Widgets can be created using the [[Edit Widgets]] feature.</p>
<p id="tooltip">{{Block|while [▼] toggled}} executes commands repeatedly while the toggle button widget is turned on. When the toggle button widget is turned off, the commands in this block don’t run. Widgets can be created using the [[Edit Widgets]] feature.</p>


===Syntax===
<div lang="en" dir="ltr" class="mw-content-ltr">
<strong>Note:</strong> It is useful to use the ‘while toggled’ block with the toggle button widget if you want the code to execute multiple times until the widget is toggled off.
</div>
 
==Syntax==
[[File:Mientras está presionado Es.png|right|alt=The While Toggled Block|thumb]]
<code>while [Dropdown: Type of Widget] toggled</code>
<code>while [Dropdown: Type of Widget] toggled</code>
Entradas:
#Seleccione el widget de botón de alternar deseado del menú desplegable.
<div lang="en" dir="ltr" class="mw-content-ltr">
==Example==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:while_toggled_example.gif|alt=While Toggled example gif|thumb]]
[[File:while_toggled_example.png|alt=While Toggled example code|thumb]]
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
When the ‘forever’ button is toggled, the ‘turtle’ agents move forward by one step and turn left by a random number of degrees between -30 and 30 degrees. This allows the agents to wander randomly throughout spaceland.
</div>


==Nuances==
==Nuances==

Latest revision as of 05:04, 13 August 2023

Other languages:


While toggled

while [▼] toggled is a code block from the interfaz drawer.

while [▼] toggled is a code block from the Interface drawer.

Usage

while [▼] toggled executes commands repeatedly while the toggle button widget is turned on. When the toggle button widget is turned off, the commands in this block don’t run. Widgets can be created using the Edit Widgets feature.

Note: It is useful to use the ‘while toggled’ block with the toggle button widget if you want the code to execute multiple times until the widget is toggled off.

Syntax

The While Toggled Block

while [Dropdown: Type of Widget] toggled Entradas:

  1. Seleccione el widget de botón de alternar deseado del menú desplegable.

Example

While Toggled example gif
While Toggled example code

When the ‘forever’ button is toggled, the ‘turtle’ agents move forward by one step and turn left by a random number of degrees between -30 and 30 degrees. This allows the agents to wander randomly throughout spaceland.

Nuances

Use this block when you want a stack of code to be continuously executed.

Related Blocks