Constantes y CASE
Publicado por Luis (17 intervenciones) el 16/08/2005 17:22:19
Hola con D6 en la ayuda viene esto:
case MyColor of
Red: X := 1;
Green: X := 2;
Blue: X := 3;
Yellow, Orange, Black: X := 0;
end;
yo intento esto:
const
GOINI: Integer = 1;
GOPREV: Integer = 2;
GONEXT: Integer = 3;
GOLAST: Integer = 4;
procedure TfrmMain.Navega(i: integer);
begin
with dmMain.tblPacientes do
case i of
GOINI: First;
GOPREV: Previous;
GONEXT: Next;
GOLAST: Last;
end;
end;
Y cuando compilo me sale esto:
ERROR: Constant Expression Expected
Con otro lenguaje Visual Objects esto lo podia hacer, ¿en que me equivoco?
Saludos!!!
case MyColor of
Red: X := 1;
Green: X := 2;
Blue: X := 3;
Yellow, Orange, Black: X := 0;
end;
yo intento esto:
const
GOINI: Integer = 1;
GOPREV: Integer = 2;
GONEXT: Integer = 3;
GOLAST: Integer = 4;
procedure TfrmMain.Navega(i: integer);
begin
with dmMain.tblPacientes do
case i of
GOINI: First;
GOPREV: Previous;
GONEXT: Next;
GOLAST: Last;
end;
end;
Y cuando compilo me sale esto:
ERROR: Constant Expression Expected
Con otro lenguaje Visual Objects esto lo podia hacer, ¿en que me equivoco?
Saludos!!!
Valora esta pregunta


0