10.1 Procedure declaration

A procedure declaration denes an identier and associates it with a block of code. The procedure can then be called with a procedure statement.

_________________________________________________________________________________________________________ Procedure declaration
-- --procedure declaration procedure header- ;-subroutine block-;-----------

-- --procedure header procedure---|-----identi  er--------
                              -quali  ed method identi  er
- ----formal parameter list|-------------------------------------------
                       -modi  ers -

-- --subroutine block-|-----block--------------------------------------
                   |-external directive-|
                   |---asm block----|
                    ----forward------
___________________________________________________________________

See section 10.3, page 352 for the list of parameters. A procedure declaration that is followed by a block implements the action of the procedure in that block. The following is a valid procedure :

Procedure DoSomething (Para : String);  
begin  
  Writeln ('Got parameter : ',Para);  
  Writeln ('Parameter in upper case : ',Upper(Para));  
end;

Note that it is possible that a procedure calls itself.