I have a problem with a for/next loop. The problem is that in this loop it creates a checkbox control which has on change and calls a function changeBrw(nIndex). The problem is that nIndex is always 5, that is the last value. How can I solve it? I was thinking of a code block but I can't find it. Can you help me please?
to avoid it making the mistake of going to take the number 6 when instead of elements in the array there are 5 I inserted these lines at the end of the loop
but then the nIndex passed on oThis:ChangeSizeBrw( nIndex ) is allways 5
any solution pls ?
FOR nIndex := 1 TO Min( nFields, 5 ) // Limita a 5 checkbox come da specifica
IF Len( ::aFields[nIndex] ) >= 2
@ nRow, nCol CHECKBOX ::aControls[nIndex] ;
VAR ::aCheckboxes[nIndex] ;
PROMPT ::aFields[nIndex][2] ;
OF ::oDlg ;
SIZE 90, 20 ;
PIXEL ;
COLOR CLR_BLACK, RGB(235, 243, 245) ;
FONT ::oFontBold ;
ON CHANGE ( oThis:ChangeSizeBrw( nIndex ) )
nCol += 100
ENDIF
If nIndex==5
EXIT
Endif
NEXT If nIndex==5
EXIT
Endifany solution pls ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
