My script sets values for over a hundred variables that are shared in the creation of several parts. Right now I have everything in one script. I set the values of the variables in a section at the top, then several sections to create the various parts. As I include more parts (and more variables) the script is getting unmanageable. My plan is to break it into many scripts, one for each part.
In this case I will need to have each script access the same set of variables. I have been experimenting with importing 'sub-scripts' into a main script. I can run code from another file, but it seems I can't have variables recognized. For example, MyName = "Doug" when executed in the sub-script does not give MyName a value in the main script, or vice versa.
I guess I'm trying to create my own method of having global variables, within the context of scripting. My hope was that I could import a sub-script and it would simply execute exactly as if it were part of the main script, but so far no success. Can anyone advise on how I might achieve my goal? Can I use the built-in system of global variables to do this?
In this case I will need to have each script access the same set of variables. I have been experimenting with importing 'sub-scripts' into a main script. I can run code from another file, but it seems I can't have variables recognized. For example, MyName = "Doug" when executed in the sub-script does not give MyName a value in the main script, or vice versa.
I guess I'm trying to create my own method of having global variables, within the context of scripting. My hope was that I could import a sub-script and it would simply execute exactly as if it were part of the main script, but so far no success. Can anyone advise on how I might achieve my goal? Can I use the built-in system of global variables to do this?