Hi,
I have this script which checks if the list has duplicate elements, and if it does, it sends error message.
ColAgain=Function({main}, {duplicate},
duplicate={};
duplicate_r={};
unique={};
For (i=1,i<=Nitems(main),i++,
If (Nrows(Loc(unique,main[i])) == 0,
InsertInto (unique,main[i]),
InsertInto (duplicate_r,main[i])
);
);
For (i=1,i<=Nitems(duplicate_r),i++,
If (Nrows(Loc(duplicate,duplicate_r[i])) == 0,
InsertInto (duplicate,duplicate_r[i])
);
);
if (Nitems(duplicate)>0,
Write("ERROR. "||Char(main)||" has duplicates.");
Caption("ERROR. "||Char(main)||" has duplicates. Check log.");
For (i=1, i<=Nitems(duplicate), i++,
Show(duplicate[i]);
);
Throw();
);
duplicate;
);
Notice that I have this line:
Caption("ERROR. "||Char(main)||" has duplicates. Check log.");
What I want to appear is this:
"ERROR. GroupVar has duplicates. Check log."
However, this appears instead:
"ERROR. {"Element1", "Element2, "ElementN"} has duplicates. Check log."
Any ideas? Thanks.