i wonder where the difference lies. and can you mention examples where it is more appropriate to use one type over the other???
thanks in advance!
Printable View
i wonder where the difference lies. and can you mention examples where it is more appropriate to use one type over the other???
thanks in advance!
Global declarations are only allowed in the General Modules.
However, declaring variable as Public (in the module) will serve the same purpose as Global.
The verdict: don't use Global - use Public.
"Public" replaced "Global" as the keyword indicating a project wide declaration.
I believe Public came into being with VB5 (although it may have been eariler) and Global was using in Vb 4 and previous.
Global is still available to support backward compatibility.
Global was used in VB2/3, Public came in with VB4 16/32bit they both mean the same but get used to using Public. ;)
Ok....I was close. :D (I started with VB3 and definately remember Global.)
And I started with VB4 16bit and you could use Public in there. I've tried using Public in VB3 but it doesn't like it. ;)