David Grinberg - 2011-09-07

+1

This is an annoying issue. It makes it very difficult to determine if an optional segment existed in the received message.

I believe that this is caused more by the initial parsing rather than the determination of the count. When the parser (PipeParser) tries to find the segment definition, it calls "GetStructure" which creates the structure, even if the structure is not required.

The effect is that all repeating segments will have a count of at least 1.
However, if there is only one repetition the count will be 1 as well.

There is no way to test for the existence of an optional segment.

I think the better solution here is to change the Parser so that it only creates segments that it needs to.