When I declare a global variable in [Code] section (Pascal Script) of Inno Setup script, is it automatically initialized to zero/empty value? Or do I have to explicitly initialize it (e.g. in InitializeSetup event function)?
var
GlobalNumber: Integer;
function InitializeSetup(): Boolean;
begin
{ Is this necessary? }
GlobalNumber := 0;
Result := True;
end;
From my experience, the variables are zero-initialized. Though, I'm not sure if I just have not been lucky.
I've done 10.000 iterations of a test code. The global variables (or various types, integer, string, pointer) were always zero-initialized.