I am sure this has been explained somewhere in the forum .. however I am having difficulty extracting a value from my xbrowse list box for the current row and the first column ..
I want to be able to double click the line, or right click and extract aArray[nrow] [1]
Here is my code for the listbox and array.
Thanks
Rick Lipkin
- Code: Select all Expand view
REDEFINE xBROWSE oLBX2 ;
ARRAY aResults ;
COLUMNS 1,2,3,4,5,6 ;
COLSIZES 100,60,300,60,50,90 ;
HEADERS "Site", ;
"Part", ;
"Desc", ;
"Price", ;
"Qty", ;
"Pic" ;
ID 121 of oGrps ;
AUTOSORT AUTOCOLS FASTEDIT LINES CELL
oLbx2:Desc:cDataType := "M"
oLbx2:aCols[ 6 ]:cDataType := "F"
oLbx2:bRClicked = { | nRow, nCol | ShowPopup( nRow, nCol, oLbx2, aResults ) }
oLbx2:bLDblClick := { |nRow,nCol | _ViewLink( nRow,nCol,oLbx2,aResults ) }
Static Func ShowPopup( nRow, nCol, oBrw, aLin )
local oMenu
MENU oMenu POPUP 2007
MENUITEM "View Link" ACTION ( _ViewLink(aLin,nRow,oBrw), oBrw:Refresh() )
MENUITEM "Delete" ACTION ( ADel( aLin, oBrw:nArrayAt ), ASize( aLin, Len( aLin ) - 1 ), oBrw:Refresh() )
MENUITEM "Select 3rd Row" ACTION ( oBrw:GoTop(), oBrw:nArrayAt := 3, oBrw:nRowSel := 3, oBrw:Refresh() )
MENUITEM "Delete All" ACTION ( ASize( aLin, 0 ), oBrw:Refresh() )
MENUITEM "Report" ACTION oBrw:Report()
MENUITEM "Excel" ACTION oBrw:ToExcel()
ENDMENU
ACTIVATE POPUP oMenu WINDOW oBrw AT nRow, nCol
return nil
//-----------------------
Static Func _ViewLink( nRow,nCol,oBrw,aLIN )
LOCAL IE, cLINK, cRICK
msginfo(nrow)
msginfo(ncol)
// errors here
MsgInfo( "Array row: " + Str( oBrw:nAt ) + CRLF + ;
"Array col: " + Str( oBrw:nAtCol( nCol ) ) )
cLINK := aLIN[1] [1]
msginfo( cLINK )
/*
IE := CreateObject("InternetExplorer.Application")
IE:Visible := .t.
IE:Navigate( cLINK )
*/
RETURN(NIL)