![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Objetos clonados
Saludos.
En una forma tengo 12 objetos Shape a los que les debo asignar una altura (height) dependiendo de un resultado obtenido en un ciclo For. Mi inexperiencia me hizo programarlo de la siguiente forma: FIBConsultaMes.First; for ciclo:=1 to 12 do begin if ciclo=1 then Shape1.height:=FIBConsultaMes.fields[0].value; if ciclo=2 then Shape2.height:=FIBConsultaMes.fields[0].value; if ciclo=3 then Shape3.height:=FIBConsultaMes.fields[0].value; if ciclo=4 then Shape4.height:=FIBConsultaMes.fields[0].value; if ciclo=5 then Shape5.height:=FIBConsultaMes.fields[0].value; if ciclo=6 then Shape6.height:=FIBConsultaMes.fields[0].value; if ciclo=7 then Shape7.height:=FIBConsultaMes.fields[0].value; if ciclo=8 then Shape8.height:=FIBConsultaMes.fields[0].value; if ciclo=9 then Shape9.height:=FIBConsultaMes.fields[0].value; if ciclo=10 then Shape10.height:=FIBConsultaMes.fields[0].value; if ciclo=11 then Shape11.height:=FIBConsultaMes.fields[0].value; if ciclo=12 then Shape12.height:=FIBConsultaMes.fields[0].value; FIBConsultaMes.Next; end; Sin embargo sé que puedo hacer algo para reducir el código para no tener 12 IF, algo así como un apuntador al objeto shape 1..12. De antemano agradezco las aportaciones a mi duda. |
|
|
![]() |
||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Duda sobre destrucción de objetos compuestos por otros objetos | noob | OOP | 11 | 16-02-2009 00:28:33 |
creacion objetos | MOCOSO07 | Varios | 4 | 04-04-2008 22:35:04 |
Objetos C# | Cheswar | .NET | 1 | 10-03-2008 16:13:27 |
almacenamiento de objetos | seduerey | OOP | 2 | 25-09-2004 21:44:07 |
Objetos | jfontane | Varios | 1 | 04-07-2003 15:39:04 |
![]() |
|