IStringList.Item

Syntax

Item(Index: Integer): String;

Parameters

Index. Element index.

Description

The Item property returns value of the element with the specified index.

Example

Sub UserProc;
Var
    StrL: IStringList;
    i: Integer;
    s: String;
Begin
    StrL := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL.Add("Number " + Math.RandBetweenI(0100).ToString);
    End For;
    s := StrL.Item(Math.RandBetweenI(0, StrL.Count));
End Sub UserProc;

After executing the example a dynamic array of strings is generated, and the "s" variable contains random array element.

See also:

IStringList