Ver Mensaje Individual
  #2  
Antiguo 09-05-2013
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.439
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Por partes....

Código Delphi [-]
procedure holamundo;
var
  boton:string;
begin
  boton:=button1;
  if boton.caption=('hola') then begin 
    boton.caption:=('adios');
  end
  else begin
    boton.caption:=('hola');
  end;
end;

La idea es buena y el código debería funcionar salvo por un detalle; Estás asignando un botón (TButton) a otra cosa que es un tipo String (boton).

Define la variable boton como TButton y prueba.

Código Delphi [-]
var
  boton:TButton;
...

Para una matriz igual, puedes definir una matriz de enteros, de strings o de Tbutton.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita