Hi,
I have different types of arrays let’s name them classA(), classB(), classC() and so on wtih same bounds (5) and needs
to reorder those like that:
0,2,3,4,1,5
At the moment , I need for all classes a seperate methoad to get right data type. When using a variant array, I need to determine all classes,
make a new variant array, copy it t varient , reorder and copy it back to the correct correct data type which seems not efficient and long coding.
I know there’s a sortWith method but this work only ascending. Is there an efficient way of reordering array of different type with specified indexes ?
Currently I do this but have a own method for each class:
[code]
dim shiftIdx as integer = if(indexToRemove>indexToInsert, 1, 0 )
if indexToInsert>theArray.Ubound then
theArray.Append theArray(indexToRemove)
theArray.Remove(indexToRemove)
else
theArray.Insert(indexToInsert, theArray(indexToRemove) )
theArray.Remove(indexToRemove+shiftIdx )
end if[/code]