Temporary Variables: Difference between revisions
No edit summary |
(Added article links and removed the spaces after each block) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Extension|extension_img= |
{{Extension|extension_img=TemporaryVariables.png|extension_desc=Create variables for use in one block stack. Useful to not clutter the variable list with variables you only use once.}} |
||
'''Temporary Variables''' is an extension for handling with temporary variables (or local variable) which can only be used in the block stack. |
'''Temporary Variables''' is an extension for handling with temporary variables (or local variable) which can only be used in the block stack. |
||
Line 6: | Line 6: | ||
the following images are made with https://scratchblocks.github.io/ and https://en.scratch-wiki.info/wiki/Block_Plugin/Syntax |
the following images are made with https://scratchblocks.github.io/ and https://en.scratch-wiki.info/wiki/Block_Plugin/Syntax |
||
[[ |
[[set () to () (Temporary Variables)|<sb>set [Variable] to (1)::#0869c2</sb>]] Set the temporary variable to a value. Can also be used for defining. |
||
[[ |
[[change () by () (Temporary Variables)|<sb>change [Variable] by (1)::#0869c2</sb>]] Change the temporary variable by a number. |
||
[[ |
[[get () (Temporary Variables)|<sb>(get [Variable]:: #0869c2)</sb>]] Get the value of the temporary variable. |
||
[[ |
[[Delete () (Temporary Variables)|<sb>delete [Variable]:: #0869c2</sb]] Delete the temporary variable. |
||
[[ |
[[delete all variables|<sb>delete all variables:: #0869c2</sb>]] Deletes every temporary variable. |
||
[[ |
[[variable () exists?|<sb><variable [Variable] exists?:: #0869c2></sb>]] Checks if the temporary variable exists. |
||
[[ |
[[current variables|<sb>(current variables :: #0869c2)</sb>]] returns a list with every temporary variables. (will not include the value of those variables) |
||
<scratchblocks>for each [Variable] in (10) { |
|||
⚫ | |||
⚫ | |||
{{ExtensionsNav}} |
{{ExtensionsNav}} |
Latest revision as of 16:36, 3 July 2024
Temporary Variables | |
---|---|
![]() | |
Description | Create variables for use in one block stack. Useful to not clutter the variable list with variables you only use once. |
Temporary Variables is an extension for handling with temporary variables (or local variable) which can only be used in the block stack.
Blocks
the following images are made with https://scratchblocks.github.io/ and https://en.scratch-wiki.info/wiki/Block_Plugin/Syntax
set [Variable] to (1)::#0869c2
Set the temporary variable to a value. Can also be used for defining.
change [Variable] by (1)::#0869c2
Change the temporary variable by a number.
(get [Variable]:: #0869c2)
Get the value of the temporary variable.
delete [Variable]:: #0869c2</sb]] Delete the temporary variable.
[[delete all variables|<sb>delete all variables:: #0869c2
Deletes every temporary variable.
<variable [Variable] exists?:: #0869c2>
Checks if the temporary variable exists.
(current variables :: #0869c2)
returns a list with every temporary variables. (will not include the value of those variables)
for each [Variable] in (10) { } :: #0869c2
loops for the specified amount of time with the temporary variables incrementing every loop. Can also be used for defining.