Solved

Difference in “scope” of two Public variables

Posted on 2006-11-03
1
168 Views
Last Modified: 2010-04-30
What is the difference in the “scope” of these two Public variables (that are in the same VB6 project):
1. variable, sPubInFrm, declared as Public in one of the project’s forms, and
2. variable, sPubInMod, declared as Public in one of the project’s modules?

Does it make any difference if the form is the "Startup object" for the project?
0
Comment
Question by:lee88
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
a public variable in a form will be available as member of the form object, managed as per instance of the form
a public variable in a module will be available everywhere in the project, single instance within the whole project

>Does it make any difference if the form is the "Startup object" for the project?
no
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now