Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> error 66 i/o not allowed here pp 323</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Error 66                    I/O Not Allowed Here                     pp 323

 Source:  Compiler

 Cause:   Enumerated types are displayed by their ordinal value,
          not the control variable name.  The control name is a symbolic
          representation of the ordinal value of that position within
          the subrange defined by the enumerated type.

 Remedy:  Use the Ord function to display the enumerated type ordinal
          value.


 ----------------------------------------------------------------------------


 Example:
       CONST
          WhiteSpace : Set of Char = [#8,#10,#12,#13,#32];
       TYPE
          Spectrum = (Red, Orange, Yellow, Green, Blue, Indigo, Violet) ;
                     { 0,     1,      2,     3,    4,      5,      6        }
       VAR
          Colors : Spectrum      ;     { Colors is subrange 0..6            }

       BEGIN
          Colors := Pred (Green) ;     { Assign ordinal value to Colors     }
          WriteLn (Ord(Colors))  ;     { Ordinal of enumerated type is ok   }
          WriteLn (Colors)       ;     { Enumerated type is not displayable }
          WriteLn (WhiteSpace[0]);     { Not displayable                    }
       END.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson