-
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.
-
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
-
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.
-
Thank you for the responses. This way of handling public variables seems strange to me, but I can live with it. :)