Dear experts!
I have to make a very large number of permutations in a class-module, but before the permutation is made the benefits of it is evaluated. In order to evaluate the move, I've made a temporary copy of the module in which the move is made and then evaluated, if the move pays off the original module is overwritten by the copy.
In pseudo code it looks something like this:
[vba]
set ClassOrg as class1
set ClassCopy as class2
for i = lbound(ClassOrg) to ubound(ClassOrg)
with classorg(i)
ClassCopy(i).data1=.data1
ClassCopy(i).data2=.data2
end with
next i
'A function who makes a permutation is called
Move(ClassCopy())
'A function named evaluate() is called, it evaluates the move
EvaluateMove = Evalutate(classcopy())
If EvalutateMove < EvaluateOld then
EvaluateOld=EvaluateMove
for i = lbound(ClassOrg) to ubound(ClassOrg)
with classorg(i)
.data1=ClassCopy(i).data1
.data2=ClassCopy(i).data2
end with
next i
end if
[/vba]
The above method works, however, since the classes contains nearly 200 entryes, it seems rather time-consumeing to cycle the classes every time a permutation has to be made.
Is there a faster way to do this?
Thanks
/troelsi