Sign in Join
Wiki copytemporary

TStringList/pl

English · Polski · Suomi

TStringList to typ danych, który może przechowywać listę ciągów o dowolnej długości. Ciągi w TStringList są dostępne jako połączony zwykły tekst lub jako seria ciągów. Dostępna jest również funkcjonalność pary klucz-wartość.

Dziedziczenie

TStringList dodaje funkcjonalność sortowania do TStrings, poprzez dodanie właściwości Sorted, Duplicates i CaseSensitive oraz metody takie jak Find, aby ułatwić przyspieszone wyszukiwanie na liście.

Przykład

pascal
  // pobierz wartość z pliku FILNAM wypełnionego parami klucz = wartość
function GetValueFromFile( filnam: string, key: string ): string;
var
  lst: TStringList;
  v: String;
begin
  lst := TStringList.Create();
  lst.CaseSensitive := false;
  lst.Duplicates := dupIgnore; // nie dodawaj duplikatów
  lst.Sorted := true;
  lst.LoadFromFile( filnam );
  v := lst.Values[ key ];
  lst.Free();
  result := v;
end;

Zobacz taże


From the Free Pascal wiki, page "TStringList/pl", as it stood on 2020-08-26 after a change by Slawek, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.