Problem with case ...else ...end
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
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
This discussion has been closed.
Comments
made the fix. We are currently performing QA for the case statements in RAP
in order to make sure everything checks ok out with this change.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com