i`m working on the legacy project in VB6 with huge object all with public variables.
I want to convert these public variables to private variable/property combinations.
Is there some tools with which i can do these conversion?(optimally all variables in class at once)
Thanks
Don’t do the conversion, it’s not needed. The VB compiler does this automatically for all exposed classes (i.e. all classes that are exported in COM DLLs) and it’s not required for all other fields since these are used internally only and there’s no difference between a field and a property for the user.
VB6 is the only language to do this right, in not allowing public fields at all, and implicitly converting them.
To recap: there’s nothing wrong with public variables in VB6 since the usual disadvantages of public variables don’t apply to them. In particular, they don’t break encapsulation.