I have an array that is created from a table and I use that array as the pick list from a combobox
- Code: Select all Expand view
aBin := {}
oRsBin:MoveFirst()
Do While .not. oRsBin:eof
cName := oRsBin:Fields("Bin"):Value
AAdd( aBin, cName )
oRsBin:MoveNext()
End Do
oRsBin:CLose()
oRsBin := NIL
...
...
REDEFINE COMBOBOX oBin var cBin ID 171 of oInvt ;
ITEMS aBin UPDATE
I have a side button function that adds a new record to the table then adds that new element to the passed array ( by reference ) .
- Code: Select all Expand view
REDEFINE BTNBMP oBTN10 ID 153 of oInvt ; // add bin
PROMPT "Add" CENTER 2007;
ACTION ( _BinView( "A", "", "INV", @aBin, @cBin, oBin ))
- Code: Select all Expand view
FUNC _BinView( cMODE, oRsBin, cFrom, aBin, cBin, oBin )
...
...
ACTIVATE DIALOG oUSERS // modal dialog
If cFrom = "INV" .and. cMode = "A"
* xbrowse( abin )
cName := oRsBin:Fields("Bin"):Value
msginfo( cName )
AAdd( aBin, cName )
oRsBin:CLose()
cBin := cName
oBin:ReFresh()
* xbrowse( abin )
ENdif
lOK1 := lOK
RETURN( lOK1 )
As I have tested .. the passed array is being appended as it was passed by reference .. but the list of values ( aBin array ) does not change when I go back and pull down the list in the Combobox.
As you can see .. I am trying to Refresh all the objects but when I return to the combobox .. aBin is not updated with my new record.
Obviously this has something to do with updating the aBin variable on the Combobox .. any help would be appreciated.
Rick Lipkin