Product Site

C.1.6. Error 8 - Unexpected THEN or ELSE.

Explanation:

A THEN or an ELSE clause was found that does not match a corresponding IF or WHEN clause. This often occurs because of a missing END or DO...END in the THEN part of a complex IF...THEN...ELSE block. For example:
WRONG                   RIGHT

if a = b then do        if a = b then do
  say "equals"            say "equals"
  exit                    exit
else                    end
  say "not equals"      else
                          say "not equals"

The associated subcodes are:
001

THEN has no corresponding IF or WHEN clause.
002

ELSE has no corresponding THEN clause.