|
-
Oct 7th, 2000, 11:12 AM
#1
Thread Starter
Addicted Member
Hello!
Can anyone tell me what's the difference between Public and Global declaration of variables/constants?
I use VB for a few years, but I still don't know that...
Zvonko
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Oct 7th, 2000, 11:14 AM
#2
Frenzied Member
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 7th, 2000, 11:14 AM
#3
Thread Starter
Addicted Member
Damn, I've mistyped the thread's title. It's Difference between Public and Global
Sorry, guys!
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Oct 7th, 2000, 11:17 AM
#4
Frenzied Member
Oh Global, I think global is the same as Public, it's only in VB5/6 for backwards compitability, it was used in VB4- I think
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 7th, 2000, 11:27 AM
#5
An intrinsic object whose purpose is to collect global methods into one object.
The Global object has no syntax. You call its methods directly.
The Global object is never used directly, and cannot be created using the new operator. It is created when the scripting engine is initialized, thus making its methods and properties available immediately.
-
Oct 7th, 2000, 11:39 AM
#6
As far as their role in declaring variables, the difference between "Global" and "Public" is:
(1) "Global" only remains in the language for backward compatibility. It was used in QBasic and earlier versions of VB.
(2) "Global" can only be used in standard (.bas) modules, whereas "Public" can be used in standard modules, forms, classes, etc.
(3) In standard modules, "Global" and "Public" have the same meaning.
"It's cold gin time again ..."
Check out my website here.
-
Oct 7th, 2000, 02:57 PM
#7
Thread Starter
Addicted Member
Thanks guys, I was just courious...
So it's the same if I declare variable as Global or as Public, although public is preferable...
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|