|
-
October 6th, 1999, 11:20 AM
#1
Global Variable
I have a standard EXE project and i want to declare global type to be known within all class moduls. If i define it as a public in a module or a class module i recieved an error message . What is the way to declare global types?
Thanks
-
October 6th, 1999, 11:40 AM
#2
Re: Global Variable
I did it before, but I forgot. So I give two suggestions.
1. pass parameter (I did in the past)
2. store in a file or DB
Hope this helps!
ray
http://homepages.msn.com/LibraryLawn/rayxu/
(lots of code, tips, links, and more!)
-
October 7th, 1999, 04:18 AM
#3
Re: Global Variable
What error do you get?
I don't have problems when i say in a module
Public Something As String
I can access it in all modules and classes within that exe.
Crazy D @ Work :-)
-
October 7th, 1999, 05:11 AM
#4
Re: Global Variable
I cannot declare Public type SOMETHING
End Type
in the module section
and then to use it in a module.
-
October 19th, 1999, 09:31 PM
#5
Re: Global Variable
Declare the variable in the General Declarations section of the form. When you got the form, click any command buttons, click on down arrow until you see "General" and select it.
kazooie21
-
October 20th, 1999, 01:58 AM
#6
Re: Global Variable
Had the same problem earlier!! Solved it by defining the components of my "type" structure in a User Defined Class.
"Add" a Class Module to your project.
In it, put
public a as string
public b as Integer
' more declarations here
' and some more here too
You can use the features of VB to add functions to manipulate only the contets of your class variables.
To make this class available in your project, define it where ever required, and "set" the class. You can even pass the classes as arguments to functions throughout your project.
You can also refer to a post I had made earlier captioned "Class inheritance problems", or something like that. There were 2 posts - I forget the name of the first one!
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
|