Back to table

Invalid call to Procedure

The following is an invalid µOCCAM program. The program atempts to call a procedure which does not exist.

Program file: /public/cs3/web/ipptests/notdeclared.reject
INT answer : -- variable to hold answers

-- Multiplies 2 variables together
PROC times(INT a, INT b)
  answer := a*b
:

INT a :
INT b :

SEQ
  a := 4
  times(3, a)
  -- answer should be 12
  b := answer

  adder(a,b) -- Procedure does not exist.
  -- ERROR

  stdout ! answer