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.

devx-admin

Share the Post: