devxlogo

Global Variables Between Applications

Global Variables Between Applications

Question:
The VB4 help files state that Public Declarations in a General module are available to all forms andmodules in all applications. Is this true? I can’taccess such variables across applications. Whatshould I do? Any help would be appreciated.

Answer:
That statement is not quite true. Very little is automatically available between applications. Here is the real interpretation of that statement: any variable declared in the declarations section of a code module is available throughout that application. They may have been referring to the fact that you can then load a code module into multiple projects at the same time. That would, in effect, make the declaration available everywhere. This concept is similar to having a text file with some common declarations that you always add to your project before you start coding.

See also  Why ChatGPT Is So Important Today
devxblackblue

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.

About Our Journalist