Global variables

amitguitarplayer

Active member
Joined
Jul 5, 2008
Messages
27
Programming Experience
5-10
Hi guys,

i am making an application where i use certain variables in all the forms. how can i declare all the global variables in one place so they can be available in all other forms and also when i run my application ?

string variables like userpath, dirpath, localpath etc..

thank you
 
Quick and dirty, add a module to the project and use the 'Friend' keyword to declare the vars

The more proper way of handling this would be to create a class to and declare it on your main form then pass a reference to it to the other forms when opening them
 
Back
Top