colindow
asked on
Public vs Global
I have some code which came from an old VB3 project.
The some constants and variables are declared as Global. In some VB6 code I have they are declared as Public.
Is there actually a functional difference between the two methods of declaration.
The some constants and variables are declared as Global. In some VB6 code I have they are declared as Public.
Is there actually a functional difference between the two methods of declaration.
ASKER
so replacing Global Const With Public Const in all bas files will not change anything but will mean that the syntax is more consistent?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No, I assumed that they were the same but just before I went for the Replace button I thought I might just check.....
They survive for the life of the application and are visible from all of the application.
Microsoft supports the term in VB6 but does not encourage its use.
Public variables declared in FORM or Class modules are only valid while that form or class is instantiated (existing).
Hope this helps, John