I am reworking the architecture of the tools I am working on.
For modularity's sake, and to keep all the various scripts compartmentalized, each rollout generally goes in its own .ms file with the functions and handlers specific to that rollout.
I have one "main" rollout from which I launch the others that are needed.
I am also trying to keep my "library" of scripts as organized and elegantly executed as possible. What I've unfortunately had to resort to, though, is doing a "fileIn 'otherscript.ms" at the top of my main script for every rollout I want to launch, in order to "forward declare" their functions I guess.
For example, what I'd LIKE to do is only fileIn a script exactly when I need it, so it's not automatically executed at the start of the main script, so:
rollout someRollout "Some rollout" ( button someButton "Launch other script" on someButton pressed do ( fileIn "otherscript.ms" launchOtherUI() --located in otherscript.ms ) )
This doesn't work. Even though I just fileIn'd the other script, launchOtherUI() is still undefined.
fileIn "otherscript.ms" rollout someRollout "Some rollout" ( button someButton "Launch other script" on someButton pressed do ( launchOtherUI() --located in otherscript.ms ) )
..which works. But, in my opinion, is not the most elegant solution since now for EVERY one of my external scripts that I want to launch, I have to fileIn them at the very start, which to me just says "bad design".
So cgsociety, please let me know what you think is a good architecture for having multiple scripts with their own rollouts, and launching them from each other!