Hola otra vez recurro a Uds porque no puedo solucionar este c贸digo
sigo con el mismo ejemplo, lo que no puedo es cargar la selecci贸n del xbrowse en un array
(1) muestra correctamente las filas seleccionados
(2) muestra correctamente los datos recorridos
(3) muestra correctamente la cantidad de elementos del array
(4) ac谩 da este error
Error description: Error BASE/1068 Error de argumento: acceso al array
Args:
[ 1] = A { ... } length: 2
[ 2] = A { ... } length: 4
Stack Calls
===========
Called from: megandc1.prg => ASOCIO1( 2005 )
Called from: megandc1.prg => FACELECTRO( 1543 )
Indudablemente no entiendo como trabaja oBrw:aArrayData
Gracias por su atenci贸n
Luis
sigo con el mismo ejemplo, lo que no puedo es cargar la selecci贸n del xbrowse en un array
function asocio1(aElectro, nclia)
local oFac, odlg1
local z , n
local aItems := array(0)
聽aFacpago := Array(0)
if !pasaje("factura");return nil;endif
聽 聽database oFac
聽 聽oFac:setorder(3)
聽 聽oFac:ordscope(0,nclia)
聽 聽oFac:ordscope(1,nclia)
聽 聽//oFac:gotop() 聽 */
聽 聽// 聽oFac:setfilter("paga" != "S" .and. "nota" != "C" .)
聽 聽//FW_DbfToArray ( cFieldList, bFor, bWhile, nNext, nRec, lRest, aData )
聽 聽//aRows := FW_DbfToArray( "DATE,TERMINAL,VALUE", { || FIELD->DATE = dDate } )
聽 聽aItems := fw_dbftoarray("fechida,nota,nrofac,Importe,tipofac",{|| 聽paga != "S" .and. nota != "C"})
聽 聽oFac:deactivate()
聽 聽xbrNumFormat( "E", .T. )
聽 聽DEFINE DIALOG odlg1 resource "DIA_ASOCIO1"
聽 聽redefine xBrowse oBrw Of odlg1 array aItems ; 聽 聽 聽 聽 聽 聽 聽 // 聽 聽 聽 聽 聽 聽 Columns 'fechida','nrofac','Importe' 聽;
聽 聽 聽 聽 聽 聽 聽columns {1,2,3,4};
聽 聽 聽 聽 聽 聽 聽Headers 'Fecha','nota','N煤mero', 'Abona';
聽 聽 聽 聽 聽 聽 聽JUSTIFY 聽, .T., .T.,.T.;
聽 聽 聽 聽 聽 聽 聽ColSizes 80,40,120,180 id 101 聽UpDate Cell AutoSort
聽 聽 With Object oBrw:InsCol(1)
聽 聽 聽 聽 :bEditValue 聽 聽:= { || AScan( oBrw:aSelected, oBrw:BookMark ) > 0 }
聽 聽 聽 聽 :SetCheck()
聽 聽 聽 聽 :nHeadBmpNo 聽 聽:= { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
聽 聽 End
聽 聽WITH OBJECT oBrw
聽 聽 聽 :lDisplayZeros := .F.
聽 聽 聽 :nMarqueeStyle := MARQSTYLE_HIGHLROWRC
聽 聽 聽 :nStretchCol := STRETCHCOL_WIDEST
聽 聽 聽 :bClrStd := { || { CLR_BLACK, Colores(oBrw:aRow[2]) } }
聽 聽 聽 :lColDividerComplete := .T.
聽 聽 聽 :lAllowColHiding := .F.
聽 聽 聽 :lRecordSelector := .F.
聽 聽END WITH
聽 聽 oBrw:bLClicked := { |r,c,f,oBrw| If( oBrw:MouseColPos( c ) == 1 , ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽AAdd( oBrw:aSelected, oBrw:BookMark ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽ADel( oBrw:aSelected, f, .t. ) ), Nil ), ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oBrw:RefreshCurrent() }
聽 聽ACTIVATE DIALOG odlg1 ON INIT oBrw:gobottom()
聽
if LEN(oBrw:aSelected) > 0
聽 聽? Len(oBrw:aselected) 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 (1)
FOR EACH z IN (oBrw:aSelected)
聽 聽? oBrw:aArrayData[z,1] 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽(2)
聽 聽? oBrw:aArrayData[z,2]
聽
聽 聽AAdd(aFacpago,{oBrw:aArrayData[z,1] ,oBrw:aArrayData[z,2],oBrw:aArrayData[z,3],oBrw:aArrayData[z,4],oBrw:aArrayData[z,5]})
NEXT
聽? Len(aFacpago) 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 (3)
聽 聽FOR EACH z IN aFacpago
聽 聽 聽 ? aFacpago[z,1] 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 (4)
聽 聽NEXT 聽
endif 聽 聽 聽
return aFacpago(1) muestra correctamente las filas seleccionados
(2) muestra correctamente los datos recorridos
(3) muestra correctamente la cantidad de elementos del array
(4) ac谩 da este error
Error description: Error BASE/1068 Error de argumento: acceso al array
Args:
[ 1] = A { ... } length: 2
[ 2] = A { ... } length: 4
Stack Calls
===========
Called from: megandc1.prg => ASOCIO1( 2005 )
Called from: megandc1.prg => FACELECTRO( 1543 )
Indudablemente no entiendo como trabaja oBrw:aArrayData
Gracias por su atenci贸n
Luis