You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 04:46:22