"Для разработчиков", "Серверные скрипты", "Описание функций", "Строки", "TStringList", "Свойства", "Count".
Получить количество строк списка TStringList.
property TStringList.Count: integer;
Количество строк списка. Если список пустой — функция вернёт 0.
var
SL: TStringList;
i, j: integer;
begin
SL := TStringList.Create;
for j := 1 to 10 do begin
SL.Clear;
for i := 1 to Random(10) + 1 do
SL.Append(IntToStr(Random(100)));
mLogScript(SL.CommaText, IntToStr(SL.Count) + ' elements');
end;
SL.Free;
end.
[17:47:17] (Log "CountProperty"): [4 elements] 50,32,98,76
[17:47:17] (Log "CountProperty"): [6 elements] 10,81,18,38,97,66
[17:47:17] (Log "CountProperty"): [1 elements] 35
[17:47:17] (Log "CountProperty"): [3 elements] 72,65,17
[17:47:17] (Log "CountProperty"): [4 elements] 39,20,91,75
[17:47:17] (Log "CountProperty"): [4 elements] 58,52,8,94
[17:47:17] (Log "CountProperty"): [4 elements] 88,67,2,37
[17:47:17] (Log "CountProperty"): [2 elements] 70,76
[17:47:17] (Log "CountProperty"): [4 elements] 56,75,46,99
[17:47:17] (Log "CountProperty"): [4 elements] 98,47,57,79
[17:47:17] (Run "CountProperty"): Время выполнения скрипта: 5 мс
[17:47:17] (Run "CountProperty"): Скрипт выполнен успешно.