Book Cover

Summary


In this chapter, you learned about the TList class, which implements the logic of a dynamic array. You learned how to use the TList class, and what its methods do. You also learned about the limitations on using TList.

To circumvent some of the problems with TList, you wrote a new class, TS_CustomList, with enhanced capabilities. The new class breaks the 64 KB barrier under Delphi 1.0. To make it easier to define custom derived classes, TS_CustomList uses virtual methods, and it has no default array property.

Based on TS_CustomList, it was then easy to write the TS_List class, which emulates TList, but without the restrictions and limitations of TList. You implemented the new list classes for Delphi 1.0 and Delphi 2.0, and explored two different ways to implement the class in Delphi 2.0.

Lists are used throughout Delphi, as are string lists. A string list is a class that inherits from TStrings, which is the subject of the next chapter.



Copyright © 1996 Waite Group Press