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
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
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: No registered users and 63 guests