PROGRAM NestedProcedure(Output);                            { program heading  }
{------------------------------------------------------------------------------}
    VAR                                                     { |                }
        I: Integer;                                         { |                }
    PROCEDURE OuterProcedure;                               { |                }
        VAR                                                 { ||               }
            J: Integer;                                     { ||               }
        PROCEDURE InnerProcedure;                           { ||               }
        BEGIN                                               { |||              }
            WriteLn('in InnerProcedure. I=', I, ', J=', J); { ||| block        }
        END; { InnerProcedure }                             { |||              }
    BEGIN                                                   { ||               }
        J := 20;                                            { ||               }
        InnerProcedure;                                     { ||               }
    END; { OuterProcedure }                                 { ||               }
BEGIN                                                       { |                }
    I := 2;                                                 { |                }
    OuterProcedure;                                         { |                }
END. { PROGRAM }                                            { |                }
{------------------------------------------------------------------------------}

{ | main block               }
{ || nested block            }
{ ||| nested in nested block }
