4
Program to demonstrate the TCollection.DeleteAll method
5
Compare with example 28, where FreeAll is used.
8
Uses Objects,MyObject; { For TMyObject definition and registration }
16
C:=New(PCollection,Init(120,10));
18
Writeln ('Initial memory : ',InitMem);
21
M:=New(PMyObject,Init);
25
Writeln ('Added 100 Items. Memory available : ',Memavail);
26
Write ('Lost : ',Initmem-Memavail,' bytes.');
27
Write ('(Should be 100*',SizeOF(TMyObject));
28
Writeln ('=',100*SizeOf(TMyObject),')');
30
Writeln ('Deleted all objects. Memory available : ',Memavail);
31
Writeln ('Lost : ',Initmem-Memavail,' bytes.');
b'\\ No newline at end of file'