PROGRAM test (input,output);

TYPE
   DaysOfWeek = (Mon,Tues,Wednes,Thurs,Fri,Sat,Sun);
   DaysOfMonth = 28..31;    (* named subrange type *)

VAR
   DaysThisMonth : DaysOfMonth;
   DaysLastMonth : 28..31;  (* legal 'anonymous type', but not preferred *)
   Today : DaysOfWeek;

   (* anonymous again *)
   Month : (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
   WeekDay : Mon..Fri;     (* anonymous type *)

   i : Integer;


   (* named enumerated type as formal parameter *)
   (* named subrange type as formal parameter *)
Procedure OK (Parm1 : DaysOfWeek; Parm2 : DaysOfMonth);
Begin
End;

                (* can not use anonymous enumerated type in proc/func
                   formal parameter list *)
(*Procedure Bad (Parm1 : (Red,White,Blue));
Begin
End; *)

(*Procedure Nope (Parm1 : 28..31);    *)
                                   (* can not use anonymous type in *)
                        (* procedure/function formal parameter *)
   (*
Begin
End;    *)

Begin
  (* DaysLastMonth := 32;     value outside range*)
  i := DaysLastMonth;   (* assingment of subrange value ok *)
  DaysLastMonth := i;   (* assignment of base type value, if within range *)
  Writeln('dayslastmonth=',DaysLastMonth);
  WeekDay := Mon;
  Today := WeekDay;    (* assgn. of base type value *)
End.