|
-
January 10th, 2000, 10:37 AM
#1
Global variables
Hi,
Does anyone know how to declare global variables, which are available in the whole project(all the forms).
Please send some code example, if possible.
Thanx,
Maarten
-
January 10th, 2000, 10:47 AM
#2
Re: Global variables
Add a BAS module to your project (called modGlobals.BAS for example), then you can add global variables there, eg :
public g_SomeGlobalString as string
public Const SOME_CONSTANT as string = "Some string That Doesnt Change"
public Const SECONDS_IN_AN_HOUR as Long = 60 * 60
In Form1 - form_load procedure :
MsgBox SOME_CONSTANT
g_SomeGlobalString = "Something else"
MsgBox g_SomeGlobalString
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
January 11th, 2000, 06:56 AM
#3
Re: Global variables
This one works also like I wanted.
Thanx!
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
|