How to make a reporter that reports the name of the variable

So i want to make a block that reports the name of a variable or list. I found an old project and copied the code but it didnt work. any fixes?

This thread may help you out

Could you be more specific on what exactly your after?

what am i supposed to look at

The code inside the script near the top - it's late where I am so my brain isn't up to the job of decoding last weeks code :slight_smile:

But I think it gets the name of the variable (or it might not - but might be worth playing with)

Need to make sure the variable is unevaluated

Scrap that - its not near the top - I'll start again on this in the morning :slight_smile:

Sorry for the noise

well ok.

I'm curious why you need this. Could you say what problem this will solve for you?

probably getting the name of the variable you inserted into a custom block to change it

By "inserted into" do you mean used as an input to it? Isn't the menu>variables option in the input type dialog the right way to do that?

No, that reports the items in said variable.

It lets you use a particular variable (the variable itself, not its name or value) as an input to a custom block. Whether you use it to look up the value or change it is up to you.

Edit: No, I lied, it gives you the name, I guess. But you can use that with CALL WITH INPUTS or RUN WITH INPUTS to get or set the value.

I'm making a block that draws a variable/list with the name at the bottom (thats the problem)

so uh... i used a dropdown for the var list, and it actually writes the variables name. now the problem is that it doesn't show the variables value

it writes the variable name twice

an easy way is this
untitled script pic (62)

untitled script pic (63)

(it has to be a variable in a ring)

Stage (2)
it works, thanks!

so how would i do the same thing but with a list

Wait- do lists have names? Is this a thing? (I’m being serious, I legitimately don’t know!)

Can you give me an example? I just don't know what you mean by "the same thing with a list"

They do in Scratch, but not in Snap!. Instead, variables have names, and you can put a list in a variable with SET like anything else.