Delphi - Constantes y CASE

 
Vista:

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!!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Constantes y CASE

Publicado por Luis (17 intervenciones) el 16/08/2005 17:30:35
Asi si funciona

const
GOINI = 1;
GOPREV = 2;
GONEXT = 3;
GOLAST = 4;

:)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar