Minor request to enhance the Variables libary

The variables lib doesn't seem quite complete

image

The delete var block doesn't have a dropdown menu

it's because it can delete multiple variables, and you can't put multiple dropdown menu inputs, like you can't do

[scratchblocks] delete var ( v) @delInput @addInput :: variables [/scratchblocks]

(it's a number input because I couldn't make an empty text input with a dropdown input in scratchblocks)

Of course - I hadn't noticed the arrows :slight_smile:

I'll just use the var block and drop it in

image

Very useful library

I used it to create this custom block

image

For some reason, a lot of the time, I forget to make a new variable sprite local and this block makes it much easier to correct my mistook :slight_smile:

that won't work. What it's getting is the value of the variable, not the variable name. So if the "var" variable value is 0, and you try to delete the "var" variable using that method, it'll try to delete the 0 variable instead.

I tried to make one myself:
link
seems like it's impossible to not have it be read-only

ok, technically I think this is possible, but it involves editing the xml, or using @wunder_wulfe's xml generator project.

Sorry - I think there was a glitch in the matrix :slight_smile:

I have a custom block that reports the name of the var

image

and I thought yours did the same - should have clicked on it and then I would have found out of course :slight_smile:

So, would you consider adding it (or a block that does the same thing) to the library?

I'm not a snap dev, so I can't add anything to libraries.

Yes you can!PR

Hey!

You can easily create your own custom block.

Note that the edited block is a new custom block with a single input (where we can use the "variables" special menu) and the "other delete block" is the block of the library (with the "multiple inputs slot").

The reason to choose that "multiple style" is to be like the "create var" block. And in these blocks, the powerful idea is to have dynamic inputs to program with them. So it seems better to have the "multiple behavior" (to play with lists) thant the dropdown behavior (that is a static behavior and we can do that with or IDE options).

Joan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.