Inno Setup常量数组声明触发编译器错误:is ('=') expected,求排查
Inno Setup编译错误排查:"is ('=') expected"
错误提示:
第70行:
第19列:
is ('=') expected
你提供的这段[Code]段代码本身语法合规,编译不会触发该错误,代码如下:
[Code] // Define the allowed passwords const allowedPasswords: array[0..1] of string = ('Passwort1', 'Passwort2'); function IsPasswordValid(password: string): Boolean; var i: Integer; begin // Check if the entered password is in the list of allowed passwords for i := Low(allowedPasswords) to High(allowedPasswords) do begin if password = allowedPasswords[i] then begin Result := True; Exit; end; end; // If the password is not in the list of allowed passwords, return false Result := False; end;
错误根源不在这段代码里,需要检查脚本第70行第19列的内容,常见问题包括:
- 配置区段(如[Setup]、[Files])的键值对漏写
=,比如写成DefaultDirName "{app}"而非DefaultDirName="{app}" - [Code]段内的赋值语句错误,比如把
Result := True写成Result True,或者变量声明后赋值漏写:= - 条件判断、常量定义等场景下缺少必要的
=符号
内容的提问来源于stack exchange,提问作者tmighty
相关产品推荐
相关产品推荐

