Global Variables

What is the command in VB6 to set a variable in a module?

I want to say:
Variable1 = 25
but I don't remember how to say that...
JFryeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pyromattCommented:
If the variable is global you should be able to say just that. To declare it globally you just use the following;

Global Variable1 as Integer
0
JFryeAuthor Commented:
I have that much, but I need to set the value of Variable1 to 25 in this example. How do I set the value?
0
TomLaw1999Commented:
If the value is constant available to all forms then

Public Const Variable1 As Long = 25

_____________________________

if it is a true Public variable then
Public Variable1 As Long

Then enter the value 25 in an appropriate place i.e.

sub Main()
Variable1 = 25
end sub






0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JFryeAuthor Commented:
Oh yeah! The SubMain() was what I was looking for. Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.