3
{ Program to demonstrate the TCollection.Foreach method }
5
Uses Objects,MyObject; { For TMyObject definition and registration }
11
Function CheckField (Dummy: Pointer;P : PMyObject) : Longint;
14
If P^.GetField<56 then
21
C:=New(PCollection,Init(100,10));
24
M:=New(PMyObject,Init);
28
Writeln ('Inserted ',C^.Count,' objects');
29
Writeln ('Last one for which Field<56 has index (should be 54) : ',
30
C^.IndexOf(C^.LastThat(@CheckField)));
b'\\ No newline at end of file'