think we have a winner :



break on

$arr1 = a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
$arr2 = 1,2,3,4,f,g,a,34,42,23,c,z,o,r


"results for arraycomp(); elements that doesn't match:" ?
"----------"?
for each $e in arraycomp($arr1$arr2)
    $e ?
next
"----------" ?

"results for arraycomp(); matching elements:" ?
"----------" ?
for each $e in arraycomp($arr1$arr21)
    $e ?
next
"----------"?

get $


function arraycomp($1$2optional $m)
    dim $
    for each $n in $2
        if (ascan($1,$n)>-1 and $m) or ascan($1,$n)+$m<0 $=$+chr(1)+$n endif
    next
    $arraycomp = split(substr($,2),chr(1))
endfunction

_________________________