RandomStr缺少运算符或分号错误

时间:2019-02-04 21:51:15

标签: delphi-10-seattle delphi-10.3-rio

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;

所有分号对我来说似乎还不错。我想念什么?

1 个答案:

答案 0 :(得分:0)

until语句末尾您缺少分号:

until (Length(Result) = strLen); // <-- here