There is a cycle that outputs from the database. Displays in turn.
In one of the fields there is a key label in the after, before which the infu does not need to be displayed, and after that it is necessary. To find out the number of this record, you need to make a cycle with checking the position of this label and only then do a data output cycle.
The label is only in one record. And all that to this record does not need to display.
With a simple condition, it turns out that I can only withdraw what's up to the mark.
And the label may or may not be
Is it possible to optimize the code so that there are not two cycles of passage in a sample of the database?
false. There is a label - output the record and set the flag totrue. If the flag istruethen output the record. - u_mulder