Variable scope acts like a devil for the user 👿

In PocketCode, you make visible objects and attach code to them. When you create variables, the scopes seem clear:

You can clone an object to get more than one. The variables in scope 2 are only available to the clones. But...

If you update a variable in one of the clones, the others don't see the change. When you make a clone, the current value is given to the clonee but the cloner keeps its own copy.

So my code for keeping track of the number of active clones fails.

Is it coming across that I'm quite annoyed by this? I'M QUITE ANNOYED ABOUT THIS.

And the only other option is a global.

=> #PocketCode | #programming

=> back to gemlog

Proxy Information
Original URL
gemini://freeshell.de/gemlog/2023-06-13_Variable_scope_acts_like_a_devil_for_the_user.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
107.976567 milliseconds
Gemini-to-HTML Time
0.45896 milliseconds

This content has been proxied by September (ba2dc).