In Class1, there's a public variable Flag of type boolean.
The defined class is used in most forms, so a variable is defined in the class instead declaring the same variables on all required forms.
When I call a function, passing this calss variable as parameter (by reference) to change the value of Flag, the value does not change. Why?
I'm using VB5 SP3.Code:' code declared in a form private sub Command1_Click() dim c as new class1 c.Flag = False sub1 c.flag msgbox c.Flag ' The value is still false afterward end sub ' code declared in main module private sub sub1(Value as boolean) Value = True end sub




Reply With Quote