record-type consts don't work in case statements.
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
For this code:
********* begin code **********
program test_consts ;
const some_constant=2;
type
some_type=record
value1:byte;
value2:byte;
end;
const init_some_type:some_type=(value1:some_constant;value2:3);
var some_var:byte ;
begin
some_var:=0;
case some_var of
init_some_type.value1: { line 13 } ;
end;
end.
********* end code **********
I get the following compile-time error:
********* begin console image **
Free Pascal Compiler version 1.0.10 [2003/06/26] for i386
Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: Linux for i386
Compiling test_consts.pas
test_consts.pas(13,26) Error: Ordinal expression expected
test_consts.pas(15,4) Fatal: There were 1 errors compiling module, stopping
* end console image ********
Everything I see says that I've got an ordinal at the point at which it's complaining.
Please tell me how I utilize a const value of a record-type const from a case statement.
The "Reference" document does not address this particular matter, so far as I can detect (pages 19-20 is where I'm looking).
Many thanks!
Additional information:
Reporter: w paddock smith
EMail: paddock at centex dot net
Mantis conversion info:
- Mantis ID: 5356
- OS: Linux
- Version: 1.0.10