Function

In WCP Pascal there are no procedures as in standard pascal. Instead everything is a function.
  function foo1; 
  begin
    // do something...
  end;

  function foo2(a, b, c);
  begin
    // do something...
  end;
A function can declare local variables and constants. These are only visible inside the function that declares them.
  function abc;
  const 
    d = 100;
  var
    e;
  begin
    e := d;
  end;
To have a function return a value, assign this value to the Result variable:
  function Cube(a);
  begin
    Result := a*a*a;
  end;