Using a procedure means, it's going to reserve a whole new context on the stack, eh? I don't want this.
Yes, and no. Procedures defined in procedures have access to their parents variables and parameters.
Normally you'd introduce procedures if they're either called multiple times or they serve a well-defined task. This is not necessarily the case.
I think this has been discussed before. Yes, other languages have "incode" variable defines. No, Pascal does not. Ive never found it an issue. I guess, my view is, Pascal is a beautiful thing, and if you want other language styles, then code in other languages.
There is something about Pascal which protects me from doing stupid things, and I need that. Me and C++, are just trouble.
NOTE: Here is a inner procedure example. I use this a lot when I want a block of code with new variables, which is only used inside one procedure.
procedure Test;
procedure Loop;
var
I: Integer;
begin
I := 3;
while I > 0 do begin
write('!');
dec(I);
end;
end;
begin
write('hello world');
Loop;
writeln;
end;