Rimantas wrote:nageswaragunupudi wrote:You may use EDIT_LISTBOX for smaller arrays.
For the kind of arrays having 800 elements etc you may better use an external function to select with EDIT_BUTTON functionality.
OK , understand ... Thanks !
Changed EDIT_LISTBOX with EDIT_BUTTON ...
WITH OBJECT oCol
:bEditValue := { || oQry:preke }
:nEditType := if( lEdt, EDIT_BUTTON, EDIT_NONE )
:bEditBlock := { | nRow, nCol, oCol | oCol:Value := brw_arr( "Choose!", { "Item", "Item name" }, aMod, oWnd ) } // mine function of array , which will return value
:bOnPostEdit := { | oCol, xVal, nKey | if( nKey == VK_RETURN .and. ascan( aMod, { |x| x[ 1 ] == xVal } ) <> 0, ( oQry:FieldPut( oCol:cExpr, xVal ), oQry:Save() ), ) } // 104 line
END
Now building app. I'm getting error : uzs.prg(104) Error E0005 Outer codeblock variable 'XVAL' is out of reach . The same xVal in other bOnPostEdit works without problem . :bOnPostEdit := { | oCol, xVal, nKey | if( nKey == VK_RETURN, ( oQry:FieldPut( oCol:cExpr, xVal ), oQry:Save() ), ) }
To what that related ?
Rimantas U.