我有一个像这样声明的过程:
procedure MyProc(List: Array of string);
我想知道如何检查List
参数是否为空。
例如:
procedure MyProc(List: Array of string);
begin
if List=[] then // here I want to check if the List array is empty
//do something
else
//do something else
end;
我怎样才能做到这一点?
最佳答案
您可以使用Length
功能
procedure MyProc(List: Array of string);
begin
if Length(List)=0 then // is empty ?
//do something
else
// do something else
end;
关于arrays - 如何检查动态数组是否为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5813986/