lcCurPart = myPart scan if not lcCurPart == myPart lcString = lcString + ")" lcCurPart = myPart endif endscan * Unfortunately, we still need to process the last record, so using this methodology needs to be done outside.Someone gave me a better idea about 2 years ago, but I don't have a minite right now to search.