[fpc-pascal]Problem with CASE statement
Matt Emson
memsom at interalpha.co.uk
Tue Mar 23 15:19:23 CET 2004
> In go32v2 i got a problem with case statement.
> With compiler 1.0.10 is this without errors:
>
> const kbDown = $5000;
> kbUp = $4800;
> var ch : char;
> begin
> ch:=ReadKey;
> case ord(ch) of
> Hi(kbDown): writeln('kbDown');
> Hi(kbUp) : writeln('kbUp');
> end;
> end.
Delphi (5 at least) enforces case items to be constants, ie. fixed at
compile time..... this looks to be the thing that's changed in the
compiler's default mode. Maybe another mode supports extended case
functionality?
Anyway, define a const for $50 and $48 and use them... aren't these values
fixed at compile time anyway ?
More information about the fpc-pascal
mailing list