Comparing one fixed size array to one dynamic array

consumer48

New member
Joined
Oct 9, 2015
Messages
2
Reaction score
0
Points
0
Location
Romania
Hello. I'm have a project that requires me to compare a fixed length array:

Code:
dim fArray(3) as variant
   fArray(0)=0
   fArray(1)=50
   fArray(2)=100
   fArray(3)=150
, to a dynamic array like this one:

Code:
dynArray(0)=0
dynArray(1)=100
dynArray(2)=150
dynArray(3)=200
dynArray(4)=250
dynArray(5)=300
dynArray(6)=350
.

The thing is though, i want to compare each element of the first array with every element of the second array, and if i get a match do something, and delete the matched elements from the second array. Then, again, compare them, see that there are no matches, calculate the difference between the first element of the first array and the first element of the second array, and add it to all of the elements of array 1, therefore equalizing them so that they can be deleted once more. And so on... i'm gonna do an example below, because i don't know if i made any sense.

A1=(0,50,100,150)
A2=(0,100,150,200,250,300,350)
after comparison, 0=0, 100=100, and 150=150 => do something, then recreate the elements:
A1=(0,50,100,150)
A2=(200,250,300,350)
compare them again, there are no matches, so add 200(elem1-elem1 of each array) to the first array=>
A1=(200,250,300,350)
A2=(200,250,300,350)
now that i have a match, all element can be deleted, so the second array will be emptied . Basically, the first array empties the second one step by step, by equalizing the elements.

I'm sorry for the long post, but it's the only way i could have explained what i need. I really hope you guys can help me. Thank you!
 
You can empty all elementes of the second array in steps, but why not in 1 go ?
You should elaborate on the advantages to do this in steps.
 
Because the program has to do something, export some data between those steps, so i need to do it sequentially. I need to export to a notepad the deleted elements, and the value of each addition done to the first array.
 
Last edited:
Back
Top