Contents | Prev | Next

13.4 Allow 'otherwise'

When the allow otherwise extension is enabled, Irie Pascal allows you to use the reserved words otherwise or else, in case statements and variant record types to specify all case constants that haven't already been specified.

For example in the following variant record

   type
      character = record
         case c : char of
         'a'..'z', 'A'..'Z'
            : (vowel : Boolean);
         '0'..'9'
            : (value : integer);
         otherwise
            ();
      end;

at the point that otherwise is used, the following case constants have already been specified

   'a'..'z', 'A'..'Z', and '0'..'9'

so otherwise specifies the remaining case constants, which in this case are all the other values of the char type.

Contents | Prev | Next