MyChat Scripts: TStringList class for working with string list

MyChat Scripts: TStringList class for working with string list

"For developers", "Server scripts", "Functions description", "Strings", "TStringList".

 

TStringList is a powerful class for working with strings. This class has everything: reading and writing to a file; sorting, adding, quick search, and deleting.

 

A numeration of the string list begins with zero. The list either sorted or "raw" (by adding date). The sorting is alphabetical.

 

The class can be divided into two large sections: methods and properties.

 

var
  SL: TStringList; // deacribing class variable
begin
  SL := TStringList.Create; // creating a class
  
  SL.Append('Test message'); // adding a string

    // accessing a string by index and its deletion
    if SL[0] = 'Test message' then SL.Delete(0);

  SL.Free; // mandatory memory release  
end.