PROGRAM VariableTypes; Var a: real;
PROCEDURE Proc1(b: real); Var c: real; Const d = 10.0; begin c := b+d; Writeln(c); end;
Function Proc2(Var e: real): real; Const f = 20.0; begin Proc2 := e+f; end;
Var g: real;
begin a := 10.0; Proc1(a); end.
PROGRAM QuickTest15 Var x: integer; PROCEDURE Show(Var a: integer); begin write(a,' '); a := a + 1; end;
begin x := 0; Write(x,' '); Show(x); Write(x); end.
The procedure is called using the technique of Passing by value Passing by reference And, hence the result will be
PROGRAM DoubleNames; Var x: integer;
PROCEDURE Show; Var x: integer; begin x := 1; x := x*x; Write(x,' '); end;
begin x := 0; Show; Write(x); end.
Cannot have two identical names for variables! 0 0 1 0 0 1 1 1