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 46 constant and case selector mismatch pp 322</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Error 46            Constant and Case Selector Mismatch              pp 322

 Source:  Compiler

 Cause:   The Case selector type does not match the constant.

 Remedy:  Examine the statement ahead of the error cursor for the above
          condition.


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


 Example:
       VAR
          Selector : Byte;                  { Selector is type Byte       }
          Choice   : Char;                  { Selector is type Char       }

       BEGIN
          Case Selector of
               1.0 : WriteLn ('Choice 1');  { Wrong - Constant is Real    }
               End;

          Case Choice of
               1   : WriteLn ('Choice 1');  { Wrong - Constant is Byte    }
               End;
       END.

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