StringList Component

Use StringList component to hold and manipulate a list of ASCII strings.

Creating a StringList:

From scripting you can create a variable of the type StringList by the following code:
var list = new TStringList();


var list = new TStringList(); list.Add("element"); list.Add("other element");



function Item(Index)

Use Item to obtain a specific string from the list. Use Item with the Count property to iterate through all of the strings in the list.

Parameter list:

Return values:

Returns the string from the given index.

function Add(Str)

Call Add to insert a new string at the end of the list.

Parameter list:

Return values:

Returns the integer index of the newly inserted string.

function Delete(Idx)

Call Delete to delete the string from the given index. Calling Delete moves up all strings in the list that follow the deleted string, and reduces the Count.

Parameter list:

function Insert(Idx, Str)

Call Insert to add item to the middle of the list. Insert adds the item at the indicated position, shifting the item that previously occupied that position, and all subsequent items, up. Insert increments Count.

Parameter list:

function IndexOf(Str)

Returns the index of the string from the list.

Parameter list:

Returns the index if the string is in the list or -1 if it's not found.

function AssignArray(Arr)

Assigns a JavaScript array to the string list. All elements of the list will be replaced by elements of the array.

Parameter list:

function LoadFromFile(FileName)

Loads a CRLF separated string list from a file.

Parameter list:

function Sort()

Sorts the elements of the list in alphabetical order.

function Clear()

Deletes all strings from the list.

property Count

Read only integer property with the number of strings in the list.

property CaseSensitive

Read and write boolean property. If this property is true search will be case sensitive.

property Text

Read only string property which contains all the strings concatenated and separated by a new line (CRLF).