Discuss Scratch
- starlightsparker
-
1000+ posts
Make, read, and delete variable blocks.
creating variables also exists– Deleting variables already exists (kinda)
in editor
this would do it in code
- yadayadayadagoodbye
-
1000+ posts
Make, read, and delete variable blocks.
I see that this is meant to be for organization?
That is really the only use I can think of for this. In most cases in programming, you'd define your variables before everything else anyways.
That is really the only use I can think of for this. In most cases in programming, you'd define your variables before everything else anyways.
- medians
-
1000+ posts
Make, read, and delete variable blocks.
Other blocks too:
set variable name [name] to [0]::variablesEdit: I'm not sure if he is active, but can the creator of the topic add this to the top (or sth like this)
change variable name [name] by (1)::variables
Last edited by medians (Dec. 11, 2024 15:55:36)
- mcsquaggle
-
500+ posts
Make, read, and delete variable blocks.
wouldn't that just be these though? Other blocks too:set variable name [name] to [0]::variablesEdit: I'm not sure if he is active, but can the creator of the topic add this to the top (or sth like this)
change variable name [name] by (1)::variables
change [ v] by (0)
set [ v] to []
- medians
-
1000+ posts
Make, read, and delete variable blocks.
wouldn't that just be these though? Other blocks too:set variable name [name] to [0]::variablesEdit: I'm not sure if he is active, but can the creator of the topic add this to the top (or sth like this)
change variable name [name] by (1)::variableschange [ v] by (0)
set [ v] to []
You can't insert reporters there, and these would be used alongside the blocks in the original post. Did you read the original post??
- hotcrystal
-
500+ posts
Make, read, and delete variable blocks.
I think we should differentiate between predetermined variables (regular variables in the editor right now) and disposable variables (mentioned here) (I want a better name than disposable). Predetermined variables are the ones that use the regular variable blocks, and the disposable variables are the ones can be created and deleted in the middle of programs mentioned here. Also, cloud variables should not be able to be disposable variables.
Last edited by hotcrystal (Dec. 11, 2024 21:38:40)
- hotcrystal
-
500+ posts
Make, read, and delete variable blocks.
define bump()
forum.post(“Bump!”)
forum.post(“Bump!”)
- 50_scratch_tabs
-
1000+ posts
Make, read, and delete variable blocks.
I do this with a list called “names” and one called “values”. To create a variable, add the name to “names” and add 0 to values. To set a variable use:
replace item (item # of (name) in [names v]) of [values v] with (new value)And to get a variable do:
(item (item # of (name) in [names v]) of [values v] :: list)So, after considering all of this, I WHOLE-HEARTEDLY SUPPORT! Maybe change the terminology a bit, but other than that great suggestion.
- medians
-
1000+ posts
Make, read, and delete variable blocks.
There could also be set/change variable blocks considering those exist for variables currently, as I stated above for change. I do this with a list called “names” and one called “values”. To create a variable, add the name to “names” and add 0 to values. To set a variable use:replace item (item # of (name) in [names v]) of [values v] with (new value)And to get a variable do:(item (item # of (name) in [names v]) of [values v] :: list)So, after considering all of this, I WHOLE-HEARTEDLY SUPPORT! Maybe change the terminology a bit, but other than that great suggestion.