function XbrToArray( Self, aCols )
local aData := {}
local nRows := ::nLen
local nRow, bm
if nRows > 0
if aCols == nil
aCols := ::GetVisibleCols()
else
aCols := { |o,i| aCols[ i ] := ::oCol( i ) }
endif
aData := Array( nRows, Len( aCols ) )
bm := ::BookMark
Eval( ::bGoTop, Self )
for nRow := 1 to nRows
AEval( aCols, { |o,i| aData[ nRow, i ] := o:Value } )
Eval( ::bSkip, 1 )
next
::BookMark := bm
endif
return aData
aData := XbrToArray( oBrw, [ aCols ] )
oBrw:bRClicked := { |r,c,f,oBrw| aResult := XbrToArray( oBrw, [ aCols ] )
oBrw:bRClicked := { |r,c,f,oBrw| aResult := XbrToArray( oBrw )
XbrToArray( oBrw. { "FIRST", "CITY", "SALARY" }
nageswaragunupudi wrote:
- Code: Select all Expand view RUN
function XbrToArray( Self, aCols )
local aData := {}
local nRows := ::nLen
local nRow, bm
if nRows > 0
if aCols == nil
aCols := ::GetVisibleCols()
else
aCols := { |o,i| aCols[ i ] := ::oCol( i ) }
endif
aData := Array( nRows, Len( aCols ) )
bm := ::BookMark
Eval( ::bGoTop, Self )
for nRow := 1 to nRows
AEval( aCols, { |o,i| aData[ nRow, i ] := o:Value } )
Eval( ::bSkip, 1 )
next
::BookMark := bm
endif
return aData
Usage:
- Code: Select all Expand view RUN
aData := XbrToArray( oBrw, [ aCols ] )
if aCols == nil
aCols := ::GetVisibleCols()
else
AEval( aCols, { |o,i| aCols[ i ] := ::oCol( o ) } )
endif
aData := oBrw:ToArray()
// or
aData := oBrw:ToArray( aCols )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], jmartial and 102 guests