Using variables within subprograms

This is on CB3 series. I have a program that runs fine by itself. There’s about a dozen or so variables in it that are local (not in installation file).

When I add this program as a sub-program in another program, I get error messages when loading about duplicate variables. This error message has 2 options to select (Rename duplicate variables, or Use installation variable). I selected rename duplicate so that I can see which ones are problematic, and it appears to be the variables in the “sub-program”. These variables are no where else in the main program.

My solution for the time being was to add the variables to the installation file, but I’d rather not do that. I don’t understand why it’s giving me a program since those variables are isolated, and the program works by itself.

Are you creating the variables through a script of through the Polyscope interface? If you are creating variables on the sub-program using the Polyscope interface (e.g. the Assignment function to initialize their values), they will be by default global variables, so they are “visible” for the main program.
If you are using a script, make sure they are declared as locals:

local var1 = 0
local var2 = "Hello"

I am creating them in the polyscope interface with the assignment function. I tried creating a script file that had some of the variables in it, but the software things the program is incomplete.