Hello, try to compile the below script. It will result in:
> Compiling [Code] section
> Error on line 10 in B:\hshgdh\Example1.iss: Column 1:
> Variable Expected.
> Compile aborted.
While the error message is correct, it incorrectly refers to Column 1 of the first script line (procedure Dummy in this case), instead of the actual location of the error.
The problem does not happen, when you similarly incorrectly try to use a constant string – ByRef('foo'), or a function result — ByRef(ExpandConstant('foo')), or when using the explicit property name – ByRef(S.Strings[0]). In all these cases the error message will correctly refer to the ByRef call statement.
Occurs both in Inno Setup 6.0.5 and 6.1.1 beta.
Spotted, while solving this question:
[Setup]
AppName=My Program
AppVersion=1.15
DefaultDirName={autopf}\My Program
[Code]
// Just some random dummy code to show that the error message refers to
// the very first line in the script, which is unrelated to the error.
procedure Dummy;
begin
end;
procedure ByRef(var S: string);
begin
end;
procedure Foo;
var
S: TStrings;
begin
ByRef(S[0]);
end;