|
-
Oct 19th, 2000, 02:00 PM
#1
Thread Starter
Frenzied Member
I dont really understand this and
I was hoping someone could explain
this to me.
For the use through all of my form
I would declare a variable "Public".
It seems to work fine! Whats the
point of declare a variable "Global".
Besides Private, Dim, Public, And
Global are there any other ways to
declare variables?
thanks!
-
Oct 19th, 2000, 02:26 PM
#2
transcendental analytic
No point to use Global since Public does the same, it's for backward compability, Private variables can also be declared with Dim, can't be accessed from outside that module. Dim is used mostly to declare variables with procedure scope, you declare them inside a function or sub, Also there's static variables which you declare static within a procedure. Their values will remain when you exit the function and not be instanced everytime you call it. Can be usefull sometimes for recursion.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 19th, 2000, 02:30 PM
#3
Thread Starter
Frenzied Member
Thanks..
Sounds like all you need is Private
and public.
Whats the point in using static,
or global!
Static if im correct will stay in
memory as long at the program is
running right? So why not just use
a public?
-
Oct 19th, 2000, 02:32 PM
#4
Global was used in earlier versions of VB but was replaced by Public in VB4.
The only reason Global is still around is so that you can load previous VB projects into newver VB projects.
(called backwards compatibility)
-
Oct 19th, 2000, 03:10 PM
#5
transcendental analytic
Static variables won't be initialized until the line is fired. It will unload if the object it exist in unloads.
Static variables are also declared at procedure level so you won't need to put it topmost, also use private instead of public as often as you can, that will save you performance.
Also, in fact, it's Dim and Public not Private and public that is the only ones you actually need.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|