The following program does nothing sensible, but can be used to demonstrate the parameter association mechanisms of Ada.
------------------------------------------------------ -- Program to demonstrate parameter association -- Skansholm, page 237 ------------------------------------------------------ with TEXT_IO; procedure param_demo is package int_io is new TEXT_IO.INTEGER_IO(INTEGER); use text_io, int_io; X, Y, Z : INTEGER; procedure nonsense ( A : in INTEGER; B : in out INTEGER; C : out INTEGER) is begin B := A + B; C := 0; end nonsense; begin -- param_demo X := 1; Y := 5; Z := 10; put(X); put(Y); put(Z); NEW_LINE; nonsense (X,Y,Z); put(X); put(Y); put(Z); NEW_LINE; end param_demo;
initialisation via parameters
statements alter local values
final values of out and in out parameters returned