This code not work (it allow only jump to upper label, not worked for lower label):
function InitializeSetup(): Boolean;
label
bye;
var
i: Integer;
begin
for i:=0 to 10 do
begin
if i = 10 then goto bye;
MsgBox(‘Exit’, mbInformation, mb_OK);
Exit;
end;
bye:
MsgBox(‘Jumped!’, mbInformation, mb_OK);
end;
It show compiller message:
Compiler Error
Line 34:
Column 6:
Invalid jump.
ОК ---------------------------
But in Delphi similar code work good:
procedure TForm1.btn1Click(Sender: TObject);
var
i: Integer;
label
bye;
begin
for i:=0 to 10 do
begin
if i = 10 then goto bye;
ShowMessage(‘Exit’);
Exit;
end;
bye:
ShowMessage(‘Jumped!’);
end;