ItemLength(Index: Integer): Integer;
Index. Array element index.
The ItemLength property returns array element length.
Sub UserProc;
Var
StrL: IStringList;
i: Integer;
Begin
StrL := New StringList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrL.Add("Number " + Math.RandBetweenI(0, 100).ToString);
End For;
i := StrL.ItemLength(Math.RandBetweenI(50, StrL.Count));
End Sub UserProc;
After executing the example a dynamic array of strings is generated. The "i" variable contains the length of array random element.
See also: