Bonjour
cela devrait être facile mais je ne peux pas comprendre par moi-même.
J'ai 2 listes et je voudrais filtrer la première en fonction de la seconde
- ColList --> contient les noms des colonnes de ma table
- CompList --> contient l'extracteur
Par exemple
ListeCol = ("aa_Lio", "aa_Leo", "ab_Lio", "ab_Leo", "ac_Lio", "ac_Leo", "ad_Lio", "ad_Leo" )
CompListe = ("Lio")
But
créer une liste que j'appelle extractCol qui serait dans mon exemple extractCol = ("aa_Lio", "ab_Lio", "ac_Lio", "ad_Lio")
voici mon scénario. Si je n'utilise pas la boucle For, ça marche...
Pour( k = 1, k <= 1, k++,
Pour( je = 1, je <= 3, je++,
Si( Contient( ColList[i], CompList[k]) >=1 ,
Insérer dans( extractCol, ColList[i] )
)
);
);
Cordialement
Lionel
NamesDefaultToHere(1);
ColList = {"aa_Lio", "aa_Leo", "ab_Lio", "ab_Leo", "ac_Lio", "ac_Leo", "ad_Lio", "ad_Leo" };
CompList = {"Lio"};
extractCol = {};
for(k=1, k<=NItems(CompList), k++,
for(i=1, i<=NItems(ColList), i++,
if(EndsWith(ColList[i], CompList[k]), InsertInto(extractCol, colList[i]));
);
);
extractCol;