TStringList vs. TList

前端 未结 8 1891
野性不改
野性不改 2021-02-05 02:31

what is the difference in using a standard

type 
  sl: TStringList 

compared to using a generic TList

type 
  sl: TList

        
8条回答
  •  旧巷少年郎
    2021-02-05 03:04

    • TStringList is a descendant of TStrings.
    • TStringList knows how to sort itself alphabetically.
    • TStringList has an Objects property.
    • TStringList doesn't make your code incompatible with all previous versions of Delphi.
    • TStringList can be used as a published property. (A bug prevents generic classes from being published, for now.)

提交回复
热议问题