devxlogo

Use a Class Module for Persistent Global Variables

When I use variables that need to be saved to the Registry or to an INI file, I sometimes forget to place the API call after the variables in a program have changed. This might cause problems later when the program is exited and restarted. Instead, use the variable in a class module that can be used as a local variable for a form/routine, or make the class a global class in the BAS module. When assigning a value to the variable when it

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.