title: How can I use WriteLn with an enum type?
body: <p>I'm trying to make a custom data type for days of the week but I can't get it to write it. The compiler error says this:</p>
  
  <blockquote>
    <p>[Error] hours.dpr(28): Illegal type in Write/Writeln statement</p>
  </blockquote>
  
  <pre><code>program hours;
  
  {$APPTYPE CONSOLE}
  
  uses
    SysUtils;
  
  type
    TypeDay = (Sun,Mon,Tue,Wed,Thu,Fri,Sat);
  
  var day: TypeDay;
  
  begin
       for day := Sun to Sat do
       begin
           writeln(day);
       end;
  end.
  </code></pre>
  
  <p>It's in Delphi 7 on Windows.</p>