[<<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.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson