List Component

List component can be used to hold items of any type.

Creating a List:

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


var list = new TList(); list.Add("element"); list.Add(3);

The list constructed in the above code will contain a string in the first position and an integer in the second.



function Item(Index)

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

Parameter list:

Return values:

Returns the item from the given index.

function Add(Item)

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

Parameter list:

function Remove(Index)

Call Remove to delete the item from the given index. Calling Remove moves up all items in the list that follow the deleted item, and reduces the Count.

Parameter list:

function Insert(Index, Item)

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 Move(Index1, Index2)

Call this function to move the item at the position Index1 so that it occupies the position Index2.

Parameter list:

function Clear()

Empty the list and set the Count to 0.

function IndexOf(Item)

Gets the index for an item in the list.

Parameter list:

Return values:

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

property Count

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