How to Control the Scope of a Variable