- 2020-09-26 at 4:12 pm #33416GlifTekLicensee
I’ve been putting a large amount of code from the clipping planes example project into separate exec text puzzles to get it more organized, controllable, and able to be used more flexibly and dynamically with my larger project.
I know the variables in them are available from within them like function scope, so I’m trying to find ready ways to make them available to others when needed…
One way was to have the first exec text in the stack be an initializer and instead of using “var myVar”, be window.myVar for each one…
I’ve read that if your var names aren’t unique enough, then using window could mess with other browser based variables.
Would this be an issue?
Another way is just hand their values of to VARS[‘myVar’] in one exec puzzle, and then back again in the next.
Or wrap them in procedures with inputs and returns to chain them.
What’s the best way? Is there any other? Thanks!2020-09-27 at 10:41 am #33444Yuri KovelenovDeveloper2020-09-27 at 8:57 pm #33459GlifTekLicensee
IMHO, VARS is better since it uses an internal namespace rather than global one.
I just put two large text areas together with a combine text puzzle into an exec thought I shared variables between execs. nope. Hah2020-09-28 at 8:23 am #33478
- You must be logged in to reply to this topic.