Back to table

Out of Scope

The following is an invalid µOCCAM program. This test declares a variable at a higher level of indentation than where it is used. The assignment is therefore out of scope and the program should be rejected.

Program file: /public/cs3/web/ipptests/out_of_scope.reject
    INT a :
    a := 2 --This assignment allowed as in scope
  a := 1   --this assignment is out of scope