RE: Need help with a loop Stan Rogers 23.Sep.17 10:44 PM a Web browser Domino Designer All ReleasesAll Platforms
Right. I don't have a working copy of Designer around to test this, so you'll need to be very careful looking at parentheses and checking the syntax and so forth. It's been a while; I'm out of practice. It should work, in principle, if we are allowed to assume that your "omit list" cannot contain values that are not in your "parse list", and that you've arranged things so they aren't already overbooked. You can sort of get around the limitations by making the code a lot longer, sloppier, slower, and harder to maintain.
Formula Language is a little bit fragile here because you can't write directly into an array element. The strategy, then, will involve creating a new array (list) by popping values off of the existing arrays one at a time. We only compare the first values of each of the sorted lists. Because this involves iteration, it is not backwards-compatible to Notes R5 or earlier. (An R5 version is possible, but it would involve the nested @If from hell and would run out of room in a hurry. You'd be much better off using Jonathan's solution than trying to go there, even if it is a horrible user experience.)
If the "parse list" value is not the same as the "omit list" value, we add it to the "out list" and remove it from the "parse list". if it *is* the same, then we simply remove it from both lists without adding it to the "out list". We keep doing that until the "omit list" is empty.
Finally, we add whatever is left in the "parse list" to the "out list", and present a trimmed version of that list to the user.
Again, I don't have Designer handy and can't syntax-check it or test it, but the idea is there and sound(ish). It ain't pretty, elegant, well-dressed or graceful, and you may find a better way given an idea of how it might be made to work. No guarantees, and good luck.