|
-
Jul 6th, 2000, 02:38 PM
#1
Thread Starter
Member
How can you declare global variables that can be used throughout all the forms in a project?
An answer would be nice, thanks,
Wick
-
Jul 6th, 2000, 04:04 PM
#2
Junior Member
declare the global variables in the Moudle
KraMba

-
Jul 6th, 2000, 04:06 PM
#3
Addicted Member
Declare them in the declarations section of a code module like:
Global x as integer
BTW, you should proabably post this type of question in the General VB forum.
Glenn D
Development/Analyst
-
Jul 6th, 2000, 09:45 PM
#4
Frenzied Member
You don't need the as integer part. But its a good idea.
If its going to always change (like some of mine do) then you can just say
Global x
-
Jul 7th, 2000, 06:46 AM
#5
Member
You should add a module to 'ur project
and have x variable declaration in there.
-----------------------------------------
oooO Knock! Knock! Ooooo
-----------------------------------------
-
Jul 7th, 2000, 01:28 PM
#6
Frenzied Member
Originally posted by SteveCRM
You don't need the as integer part. But its a good idea.
If its going to always change (like some of mine do) then you can just say
Global x
If you don't declare the type, doesn't it default to a variant data type (which is horribly slower than other declared types)?
-
Jul 7th, 2000, 01:48 PM
#7
Addicted Member
-
Jul 7th, 2000, 02:04 PM
#8
Frenzied Member
You can get them if you're not careful with your Dims. Consider:
Dim a,b,c as integer
only c will be an integer, a and b will be created as variants
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
|