Experts out there - quick question...
In Excel VBA, I have created a class which holds 4 string variables - No constructor and nothing else.
Now, in my code, I am looping through an ENORMOUS array (100k + iterations) Constantly creating a new instance of the class, assigning values to its variables, using it then assigning it toMyClass = nothing. Then looping again:
Dim x As New MyClass
Set x = Nothing
For i = 0 to 1000000
x.Var1 = "XYZ"
x.Var2 = "abc"
x.Var3 = "123"
x.Var4 = 456
... Use x ...
Set x = Nothing
Next i
Given this usage, would it be more memory efficient to define x as a class or as a public type (or doesn't it really make a difference)??
Thanks!!