Click to See Complete Forum and Search --> : Global Variable
October 6th, 1999, 11:20 AM
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
rayxu
October 6th, 1999, 11:40 AM
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!)
Crazy D @ Work
October 7th, 1999, 04:18 AM
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
I cannot declare Public type SOMETHING
End Type
in the module section
and then to use it in a module.
kazooie21
October 19th, 1999, 09:31 PM
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
deepak_warrier
October 20th, 1999, 01:58 AM
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!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.