I don't think the scope of variables is coupled that closely with the idea of unstructured, "spaghetti" code programming. I think of "spaghetti" code as something like Module 1 calls Module 2, Module 2 calls Module 3, Module 3 goes to Module 1, not returning to Module 2. Not necessarily having anything to do with variable scope.
I think there is a problem with making absolute statements like "You should never do this" because there may an exception. The rule is not what is important; what is important is the reason for the rule. If the reason for the rule is understood, sometimes breaking the rule is not a problem.
Take care,
Joe
>Our designers want our mainly DOS based cutomers to have the ability to use the mouse, the appropriate keys on the keyboard as well as a "Reports" menu pad to access a Right-Click popup menu. In order to be able to use the "Reports" menu, I had to pass in an object as parameter, storing it as a Public variable in the menu setup and setting the variable to .NULL. in the cleanup section before releasing the variable.
>
>I don't know if this is the best solution, but it was the only 1 I could find. I agree with the others about Public variables. The really take one back to GW BASIC and it's ability to write "spaghetti" code.
>
>Mike
Joseph C. Kempel
Systems Analyst/Programmer
JNC