Hi nonZero,
Thanks for replying again.
no need to apologise, your code from last night put me on the right track.
I now do something similar to your second answer.
I do have a few questions though......
Q1/ in
Begin FOR-llop check of array1$() against array2$()
FOR i = 1 TO ARRAY COUNT (array1$())
IF array1$(i) = array2$(i)
INC count `If there's a match, increase counter
DIM list(count) `DIM/REDIM list()
list(count) = i `Add index number that matched to list
ENDIF
NEXT i
you dim the array list every time the loop is run until you reach the end of both arrays.
Is this good practice? I realise diming the array with the correct number of elements is not possible AT THIS POINT in the code and the only work around I can think of is conveluted and quite messy (as are most of my little work arounds.)
I'm just concerned about memory usage. I'm 90% certain that when you re dimension an array it will over write the previous unstance but I would like it clarified from someone who knows better. (you
) Would adding another element on the top of the array each time one is required be a suitable alternative?
I think I understand how the rest of the code works but lets say for example...
elements 4 and 6 match.
the list() array is dimensioned (I always used to thingk DIM stood for define in memory?!?!) The first number added to the index would be 4 and the second 6?
FOR i = 1 TO ARRAY COUNT(list())
`Delete each element in listed in list() from array2$()
`I subtract 1 each iteration because each time an element
`from array2$() is deleted, the array shrinks, displacing all
`remaining elements
ARRAY DELETE ELEMENT array2$(0), list(i) - (i - 1)
NEXT i
runs and counts the arrays in list() these aer indexed 4 and 6 even though there are only 2 of them?
I'm pretty sure thats what happens but again I would appreciate it if you could confirm it for me.
The code you showed doesn't do 1 thing that I did require and thats check every element in array 1 against every element in array 2.
I have got it figured out but it's slow if a long string is entered for comparison.
I also had a strange error which crashed the compiler.
At the end of both arrays was a blank field.
I'll neaten up my code and paste it in here, maybe you can offer some advice?
Many thanks for your gelp.
Paul.
pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6