Click to See Complete Forum and Search --> : Class that references a Global variable?


cgchris99
April 9th, 2002, 04:45 PM
I am creating a class. But I have some code in the class that needs to check a boolean that I have global on Form1. right now it give an error.

I have created the variable in the Declartion section of Form1. Right under Public Class Form1

How do I do this? Did I create the global variable in the wrong place?

Should I create a class for my global variables?

Thanks for any advice

Craig Gemmill
April 9th, 2002, 06:24 PM
You should put your global variables in a module:

Click [Project] > [Add Module...].



public globalVar as string

cgchris99
April 10th, 2002, 11:08 AM
Any reason I should not just create a Class to hold all my Global Variables?

Makes it very obvious when I reference Global.myvariable=xxxxx