Stephen asked:
function FindFirstMatch (List: TItemList; Status: TItemStatus): Integer;beginfor Result := 0 to List.Count - 1 doif List[Result].Status = Status thenExit;Result := -1;end;The main objection is the use of Exit, but the only simple way I can see to write around that is to add a local variable:
What's
wrong with Exit? I use this idiom all the time - it's equivalent to the C
return statement and very handy.
TTFN,
Paul.