Variable reference problem

https://snap.berkeley.edu/snap/snap.html#present:Username=d4s_over_dt4&ProjectName=scheme%20out%20scratch&editMode&noRun
I don't know why,but if you run the result of


then the resulting custom block says "X is not defined" while it is defined as a parameter
Dragging away the (x) varables and redropping them would fix this.

Is able to isolate problem


untitled script pic (38)

Also,doing this


Obliterates the input a

Well,it seems that jens wants us to define stuff like this :slight_smile:


But using the aforementioned way shouldn't bug!Maybe its related to the various bugs about %s and 's in block spec?
Quick fix:

if(this.args[1].includes("%")/*or whatever used in morphic*/)throw new Error("No using % to make inputs!");

:rofl:

Another bug:
define-cbn defines the block correctly now(because I fixed it) but then registers the wrong block into vars(a grey command global block,regardless of what's actually there:a green reporter local block)

how is it a bug? it just looks to me like you wrote the code incorrectly, so the incorrect thing happened. where did you even get the "a" variable from if not the ring?

rename
i never knew that it was a bad way until i posted this

i didn't even know that dialog was there for variables, i thought it was only upvars and globals/locals in the pallete

jens keeps complaining that people treat variables as text, i'm guessing that's the biggest reason why. the OF block and metaprogramming definitely doesn't help either