/* Copyright (C) 1995 by Thomas Glen Smith. All Rights Reserved. */
/* memixe APL2 V1.0.0 **************************************************
* Called from memixcm to complete processing for member and indexof *
* when the input data is nested (APLAPL). *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
Aplcb memixe(key,left,rite,out)
int key;
Aplcb left,rite,out;
{
Errstop; Aplmatch;
extern int indxorg;
int i,j,k,*op;
Aplcb *lp,*rp,*lw;
lp = left->aplptr.aplapl;
rp = rite->aplptr.aplapl;
op = out->aplptr.aplint; /* output data ptr */
for (i=0; i<rite->aplcount; i++) {
lw = lp; /* left data ptr */
k = 0;
for (j=0; j<left->aplcount; j++) {
k = aplmatch(*lw++,*rp);
if (k) break;
}
if (key) k = j+indxorg; /* it is indexof */
*op++ = k;
rp++;
}
return(errstop(0,left,rite,out));
}