DarknessX
09-04-2007, 07:10 PM
Hey guys... How would you halt JUST the current procedure, but continue with the program from where you are?
IE,
Procedure Exa;
begin
if blue <> green then begin
{...}
end;
if yellow <> input then begin
{...}
end;
if yes = yes then begin
Writeln('YES!');
Halt(Exa); {halt the current procedure...}
Purple := 'YES';
end;
Writeln('No.');
Writeln('Is the answer.');
Purple := 'NO'';
end;
begin
Exa;
Writeln(Purple);
end.
Result:
YES
How would I do something like that? (NOTE: that is not real code. AFAIK, it will not work.)
IE,
Procedure Exa;
begin
if blue <> green then begin
{...}
end;
if yellow <> input then begin
{...}
end;
if yes = yes then begin
Writeln('YES!');
Halt(Exa); {halt the current procedure...}
Purple := 'YES';
end;
Writeln('No.');
Writeln('Is the answer.');
Purple := 'NO'';
end;
begin
Exa;
Writeln(Purple);
end.
Result:
YES
How would I do something like that? (NOTE: that is not real code. AFAIK, it will not work.)