Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Declaring a variable so that it can used in the whole form
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
strygwyrm




PostPosted: Mon May 12, 2008 9:56 am   Post subject: Declaring a variable so that it can used in the whole form

hi,
I was wondering if there was a way to declare variables in a way so that they could be used through out a whole form. In an instance like this one variable should continue onto the next object (button). I saw some tutorials on the Microsoft website about shared decelerations but they were too advanced for my understanding.
The reason i need this is that i am working on a dice game with two different buttons for two players and another button to compare the scores. I would like to have different variables declared in each button and calculated there. and then these variables should be carried on to the compare button so that the program could determine the winner.
Thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
pkjr92




PostPosted: Thu Jul 24, 2008 11:04 pm   Post subject: Re: Declaring a variable so that it can used in the whole form

Use "Public"

ex.

Normal = Dim Var1 As String

Public = Public Var1 As String
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: