You need to remember that the 26 bytes of variable storage are shared between all program slots. This means that you either need to insure that all variables are defined identically in all your programs, or you will have to assume that none of your variables will be preserved whenever you execute the run command.
I go with the former strategy, and to help me accomplish this, I wrote a BASIC Stamp Preprocessor which allows me to include a file which contains all data definitions into all my source files.
The preprocessor is available in the Programming section of the White Papers.
The older versions of my white paper have gone missing, and the one that is currently there only mentions the features added in that version of the program. Hopefully, this weekend I will be able to upload an update of the preprocessor and some more complete documentation.
In the mean time, you will need to know that the syntax for including a file is: