Converting get name of var code to Snap!7

I tried loading my big Mayflower project into Snap!7 but it came up with errors

I've narrowed it down to this issue

This code (slight edit due to mistook)

lets me access the name of the supplied variable to custom block as well as its value

Is there a another way of doing this in Snap!7 (no JS) as it was using a side-effect feature that no longer works

https://snap.berkeley.edu/versions/previous/snap.html#present:Username=cymplecy&ProjectName=getVarName&editMode

Came up with this awful method - make the var an upvar and then change its name to the name of variable I'm interested in, prefixed by a single char (can be anything)

image
It works but it's a very bad hack! :frowning:

ProjectName=getVarName7a

untitled script pic - 2021-12-13T010642.186
untitled script pic - 2021-12-13T011308.905

how did you download or go on the webesite that has snap7

Snap! 7 - rc6 - Build Your Own Blocks

Unfortunately, the join input list doesn't return the name of supplied variable - it returns the internal var name :frowning:

untitled script pic (11)
untitled script pic (10)

untitled script pic (9)

For me it seems OK: present:Username=dardoro&ProjectName=VarName
There is no need to ringify "v".

It doesn't work for me when inside a custom block
image

This might be working - looks hopeful :slight_smile:
image

Yep - seems to work in both 6.9 and 7 - thanks very much :slight_smile:

ProjectName=getVarNameC

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