Compare arrays via index

Preface:New to Notes Development.

I have searched around found how to compare arrays but can’t find any examples of what I am trying to do. If someone could lead me in the right direction it would be appreciated.

I have two arrays of file names with modified times.

fil.zip - 05/25/2005 02:45:31 PM

Doc1.doc - 05/27/2005 09:29:51 AM

Code.txt - 05/27/2005 04:01:28 PM

fil.zip - 05/25/2005 02:45:31 PM

Doc1.doc - 05/27/2005 09:29:51 AM

Code.txt - 06/07/2005 05:01:28 PM

I need to compare each list and do something when in this example it gets to Code.txt, since the date is different.

I know how to do the Forall x in y. What I was wondering is if there is a way to compare item(0) to otheritem(0). The sort of the list will always match since the come from the same source.

Subject: Compare arrays via index.

Something like this?

For x = 0 to ubound(array1)

if array1(x) = array2(x)

  ' then do this

else

  ' do that

Next

Subject: RE: Compare arrays via index.

Just tried it. That was exactly what I was looking for. Thanks. I’m kind of sad it was so simple.

Subject: RE: Compare arrays via index.

I’m kind of sad it was so simple.

In that case here you go:

dim equal as boolean

forall x in array1

dim i as long

dim ndx as integer

i = 0

forall y in array1

if y = x then

ndx = i

exit forall

else

i = i + 1

end if

end forall

if x = array2(ndx) then

equal = true

else

equal = false

end if

if equal then

’ Do nothing

else

’ Do something

end if

end forall