+= block reports "variable doesn't exist"

I've been trying to create a block, ([ V]+=()::grey) which does the action to the variable, and should apply the new value to that variable. but here's a test run (this should report 6):

pic

And this (which should report 12), also reports the same error.

operation and assignment script pic

Here's the definition for the += block.

def pic

Any help would be appreciated, thank you! :slight_smile:

I gave it the context of (this [caller V], and it fixed it
untitled script pic (32)
[offtopic]scripts out of context[/offtopic]

Thank you! However, this still raises an error at this block:

operation and assignment script pic (1)

Your problem seems to be that the "create variables" library and the "of (this caller)" blocks aren't playing nice together. However, the metaprogramming library comes with two blocks that work quite nicely.

get of caller

set of caller

Not only that, but it doesn't even require any "extension" blocks!


I'll let you figure out how you want to use these in your blocks.

This will work, too:
Programming tools DEVLAB script pic (3)
Note: variable is of type Any (unevaluated).

Demo
Programming tools DEVLAB script pic (4)

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