FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour C贸mo crear gets dentro de un bucle For...Next
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
C贸mo crear gets dentro de un bucle For...Next
Posted: Fri Mar 30, 2007 11:34 AM
Me gustar铆a poder crear 30 gets dentro de un bucle For... next. Algo m谩s o menos as铆:
// --- Initialize
oGet := {}
aGet := {}
For i := 1 TO 30
     AADD(oGet, Nil)
     AADD(aGet, Str(i))
Next
// --- Create Gets:
nR := 0; nC := 0
For i := 1 TO 30
     nR, nC GET oGet[i] Var aGet[i]
     nR += 1
Next

Pero este ejemplo no funciona. Todos los gets muestran el mismo valor 30, o sea, el balor final del For... next). Llevo un buen rato d谩ndole vueltas pero estoy bloqueado. Alguien podr铆a sugerirme c贸mo hacerlo?

Rafael
Posts: 77
Joined: Wed Jun 28, 2006 06:38 PM
C贸mo crear gets dentro de un bucle For...Next
Posted: Sat Mar 31, 2007 12:05 AM

que tal rafael, se que esto declara muchas variables publicas pero no encontre otra forma, cualquier sugerencia bienvenida; mira yo lo resolvi asi:

public wcampo1,wcampo2,wcampo3...

for j = 1 to 30
wvar := 'wcampo'+trim(str(j,2)) //WVAR no tiene declaracion previa
@ ren ,col get aGets[j] VAR &wvar OF ODlg PIXEL SIZE 40,10
next n

Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
C贸mo crear gets dentro de un bucle For...Next
Posted: Sat Mar 31, 2007 07:39 AM

Alex:
Enrico, en el Forum en ingl茅s, me ha dado una soluci贸n muy elegante que funciona perfecto y no consume variables p煤blicas. La tienes en :

http://fivetechsoft.com/forums/viewtopi ... 9111#29111

Gracias y un saludo,
Rafael

Continue the discussion