Item(Index: Integer): String;
Index. Element index.
The Item property returns value of the element with the specified index.
Sub UserProc;
Var
StrL: IStringList;
i: Integer;
s: String;
Begin
StrL := New StringList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrL.Add("Number " + Math.RandBetweenI(0, 100).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: