Oh.
At least a single </span>
endtag isn't that bad.
Apparently what we really need is the VALUE OF block of this:
which returns the value of a variable name given to it. I need it for this:
Edit: It's in the Create Variables library:
I don't want to use JS.
I don't see how else to get a variable from a string, unless you want to completely remake variables in pure Snap!.
Edit: I'm actually going to go do exactly that.
Edit 2: And it's here.
For global i sprite local variable but not the script vars.
I didn't know that! Thank you!
Yes, it seems slightly under-dcoumented
as the menu shows only the sprite local variables.
I wonder what can get that.
If you need script vars You may experiment with
but I see no way to get the variable name from a single parameter in a vanilla snap.
I'm thinking of using the (scripts) block someone made, and getting the value of a script variable from it.
But "script builder library" is almost pure JS. So why not
(a really long time later)
Now that Snap! 7 has come, I've edited my project to use the Create Variables library.
I tried this but it gave me an error
You need to ask a sprite for it to work.
Remove the call block, and unringify the join block
Woah thats odd
With the call block, it doesn't put the variable into context, but when you ask a sprite for it, it puts it into context. I don't like it either, but it's just how it works. Here's a better explanation
a symbol needs to be put into a context to be be associated with a meaning. At the syntax-analysis level blocks are just that - symbols. You can take them apart and reassemble them. Then you put them into a context. Some blocks don't require an explicit context, e.g. the math operators, because they don't have side effects. Variables require an environment. There is no such thing as a "global" or "local" variable symbol, because variables are dynamically resolved at runtime. You don't want to as…
(More info can be found by readingthrough that topic)