Value of a cell with xbrowse and arrays

Value of a cell with xbrowse and arrays

Postby Rick Lipkin » Tue Jun 07, 2011 3:39 pm

To All

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)


 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Value of a cell with xbrowse and arrays

Postby Rick Lipkin » Tue Jun 07, 2011 4:19 pm

To All

Found the solution to my own question .. here is the answer :

//-----------------------
Static Func _ViewLink( nRow,nCol,oBrw,aLIN )

LOCAL IE, cLINK, cRICK

cRICK := oBrw:aCols[ 1 ]:Value // returns the value of the current row for a column
msginfo( crick )
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Value of a cell with xbrowse and arrays

Postby nageswaragunupudi » Tue Jun 07, 2011 5:15 pm

Mr. Rick
Yes. Thats the answer.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests