RandomStr缺少操作符或分号错误

问题描述 投票:0回答:1
function Randomstring(strLen: Integer): string;
var
  ID: string;
begin
  ID := 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890';  
  Result := '';
  Repeat
    Result := Result + ID[Random(Length(ID)) + 1];
  until (Length(Result) = strLen)
end;

所有分号只是似乎没什么问题。我在想什么?

delphi-10-seattle delphi-10.3-rio
1个回答
0
投票

这是因为丢失在until声明的末尾分号:

until (Length(Result) = strLen); // <-- here
© www.soinside.com 2019 - 2024. All rights reserved.