Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem with case ...else ...end

edited November 2002 in RAP
Hi,

I have a problem with the else part of a case statement.
This works:

begin
case SQLSource['value'] of
1:
begin
Text := 'Value 1';
Label1.Color := clRed;
end;
2:
begin
Text := 'Value 2';
Label1.Color := clBlue;
end;
3:
Text := 'Value 3';
else
Text := 'Value out of Range';
end;
end;

The following code raises an error:

begin
case SQLSource['value'] of
1:
begin
Text := 'Value 1';
Label1.Color := clRed;
end;
3:
Text := 'Value 3';
2:
begin
Text := 'Value 2';
Label1.Color := clBlue;
end;
else
Text := 'Value out of Range';
end;
end;

I only changed the constants 2 and 3 and get the compile error:
numer or 'end' expected, 'else' was found (or so, retranlated from german)

Any ideas?

Michael

Comments

This discussion has been closed.