I am experiencing a compiler error saying:
Line 70:
Column: 19
is ('=') expected
What did I do wrong?
[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;

Because Inno Setup Pascal Script does not support explicitly typed constants. So after the constant name (
allowedPasswords), the only acceptable symbol is the equal sign (=) followed by a constant value.Moreover the Pascal Script does not support array constants.
For alternative code to create array of acceptable values, see:
Though in many cases, using
TStringListis more convenient: