Mega Code Archive

 
Categories / Delphi / Examples
 

Stringlists

STRING LISTS Using StringLists can be a little confusing. Here are the important things to remember: 1) Declare it 2) Create (and then Free) your StringList 3) Use Append to add strings to the list 4) Access individual strings using myStringList[0] etc (NOT myStringList.Items[0] or myStringList.Strings[0]) Here's some example code: var dirList: TStringList; tempFileName: String; begin dirList := TStringList.Create; dirList.Append(tempFileName); dirList.Free; end