Tema: Duda con for
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/12/2008, 08:30
spiderman78
 
Fecha de Ingreso: abril-2008
Mensajes: 281
Antigüedad: 16 años, 1 mes
Puntos: 1
Respuesta: Duda con for

Cita:
Iniciado por magTpeak Ver Mensaje
HOla, estoy haciendo un bucle y no me funciona esto:
Código:
For i = 0 To 12 Step 1
Textf(i).Text = Textf(1).Text
Next
Es para ahorar lineas y no poner:
Textf(1).Text = Textf(1).Text
Textf(2).Text = Textf(1).Text
Textf(3).Text = Textf(1).Text
Textf(4).Text = Textf(1).Text
Textf(5).Text = Textf(1).Text
..........
Y no me funciona Me dice: "El elemento 0 del matriz de controles no existe" y se colorea la linea 2, o sea:
Textf(i).Text = Textf(1).Text
Saludos y gracias de antemano!

Que tal, mira segun yo ahi el problema es q tus texbox empiezan con el 1 y el for lo estas empezando desde cero tendria que ser de esta manera

Código:
For i = 1 To 12 Step 1
Textf(i).Text = Textf(1).Text
Next