CASE statement
Posted: Sat Sep 24, 2011 11:38 am
Hi,
as noticed in Oberon07.Report.pdf: 'The case expression must be of type INTEGER, and all labels must be non-negative integers.'
ok, so far so good, but here is my code and problem:
The last case label is set to a value of 270, as u can see above. i get a compilation' error bad case label'.
When i use values below 256 everything compiles fine.
How can this be ?
Regards Michael
as noticed in Oberon07.Report.pdf: 'The case expression must be of type INTEGER, and all labels must be non-negative integers.'
ok, so far so good, but here is my code and problem:
Code: Select all
PROCEDURE SetOrientation( ort: INTEGER );
VAR
lcdOrientation, lcdWidth, lcdHeight: INTEGER;
BEGIN
CASE ort OF
0: lcdOrientation := 0; lcdWidth := 320; lcdHeight := 240; WriteCmd( 016H, 0A8H )
| 90: lcdOrientation := 90; lcdWidth := 240; lcdHeight := 320; WriteCmd( 016H, 008H )
| 180: lcdOrientation := 180; lcdWidth := 320; lcdHeight := 240; WriteCmd( 016H, 068H )
| 270: lcdOrientation := 270; lcdWidth := 240; lcdHeight := 320; WriteCmd( 016H, 0C8H )
END
END SetOrientation;
When i use values below 256 everything compiles fine.
How can this be ?
Regards Michael