I've got a program made up of 20+ units that I am trying to clean up.
Several of them use the same procedure, so it makes sense to put the common routines into a separate unit and call the routines as required. That way the code only exists once.
But these routines have a lot of variables which are declared in the parent unit.
When I compile the shared routine I get lots of "Undeclared Identifier" errors (what a surprise!)
Declares the variables
Has a USE to the shared routine
Call the shared routine
has the common procedure
Where should I declare the variables? Or do I need to make them all global and be done with it?