I can't use inside FOR/NEXT "REDEFINE GET ...."
It´s a sample of error:
- Code: Select all Expand view
- Function Test()
Local oDlg
Local aVar := {"1","2","3"}
Local aGet := Array( 3 )
Local nNum
Define Dialog oDlg
For nNum := 1 To 3
nID := 4000 + nNum // I´ve IDs(4001,4002,4003) in resource from pelles ( all Gets ).
Redefine Get aGet[nNum] Var aVar[nNum] ID nID Of oDlg
Next nNum
Activate Dialog oDlg
Return Nil
It´s compile, more Var was lost. no display correcty values.
- Code: Select all Expand view
- Function Test()
Local oDlg
Local aVar := {"1","2","3"}
Local aGet := Array( 3 )
Local nNum
Define Dialog oDlg
For nNum := 1 To 2
nID := 4000 + nNum // I´ve IDs(4001,4002,4003) in resource from pelles ( all Gets ).
Redefine Get aGet[nNum] Var aVar[nNum] ID nID Of oDlg // it´s wrong vars vaues is incorrect.
Next nNum
Redefine Get aGet[3] Var aVar[3] ID 4003 Of oDlg // it´s ok
Activate Dialog oDlg
Return Nil
My Solucion was do without use For/Next.
( confuse,,, logic is correct,,, I´cant understand why... )