|
-
Nov 10th, 2000, 04:31 PM
#1
Thread Starter
New Member
I have an MDI form called mdiMain. In it I declare
Public test as Boolean
mdiMain calls another form and within a method in that form I set 'test' to true. When I run it I get a compiler error that 'test' is not defined. However if I set 'mdiMain.test' to true it works. I don't understand this.
-
Nov 10th, 2000, 04:39 PM
#2
It's a public variable, so it can be accessed between modules, but you still need to tell where the variable was declared(or whatever, if "declared" is the wrong word...). that's why you need to say mdiMain.test
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 10th, 2000, 04:45 PM
#3
Lively Member
If you declare the variable as public in the standard module then you can refer it without giving the form name but when you give public even in the MDI form you have to refer it with the form name.The final saying is that even though you declare the variable as public in forms,you have to access them with the form name but when you declare it in the std module then it will be visible to the whole project.
-
Nov 10th, 2000, 05:18 PM
#4
Thread Starter
New Member
Thank you for the responses. This way of handling public variables seems strange to me, but I can live with it.
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
|