Hola la opción de ocultar la columna me da error de array.
La opción de bchange funciona bien (yo la habia probado pero solo me funcionaba cuando cambiaba de fila no de columna) supongo que oBrw:lColChangeNotify := .t. hace que también funciona para columnas.
Si veis la foto superior vereis que lo que cambio son unas variables que representan información de la celda, encima del array.
Cuando encuentra los datos en el fichero lo refrescar bien y todo funciona ok.
Pero cuando entra en una celda que no tiene valor, le asigno valores de "" a la variables y al refrescar me da el siente error.Estoy haciendo todo tipo de pruebas pero no consigo nada.
¿Alguna ayuda? por favor . Gracias.Si quito el refresco funciona bien pero claro no me refresca los valores a espacio en blanco- Code: Select all Expand view RUN
DEFINE DIALOG oDDATOS RESOURCE "FOLDER" TITLE " " OF oApp:aMod[20]:oWnd
REDEFINE get gvfcliente Var vfcliente ID 102 of oDDATOS when lsay
REDEFINE get gvfnombre Var vfnombre ID 103 of oDDATOS when lsay
REDEFINE get gvfarticulo Var vfarticulo ID 104 of oDDATOS when lsay
REDEFINE get gvfdetalle Var vfdetalle ID 105 of oDDATOS when lsay
REDEFINE get gvfcantidad Var vfcantidad ID 106 of oDDATOS when lsay
VASCII:= 65
for i:=1 to vcolumnas+1
if i = 1
AADD(V_Header," ")
AADD(V_Colsize,50)
ELSE
AADD(V_Header,chr(VASCII++))
AADD(V_Colsize,100)
endif
next i
vllenandofilas:='space(10)'
for i:= 2 to vcolumnas
vllenandofilas:=vllenandofilas+',space(10)'
next i
for i:=vfilas to 1 step -1
aadd(tfilas,{transform(i,"999"),&vllenandofilas})
next i
area:=select()
cdestant := OpenDbf(fdestant,1, , , , kdestant,"DBFCDX")
(cdestant)->(DbSetOrder(1))
(cdestant)->(Dbgotop())
acdestan:=select()
dbseek(vestanteria)
do while !eof() .and. (cdestant)->estanteria = vestanteria
tfilas[(cdestant)->fila,(cdestant)->columna]:= (cdestant)->articulo
dbskip()
enddo
(cdestant)->(Dbclosearea())
select(area)
REDEFINE XBROWSE oBrwt ID 101 autocols;
HEADERS V_Header ;
SIZES V_ColSize ;
ARRAY tfilas CELL LINES of oDDATOS
WITH OBJECT oBrwt
:bRClicked:= {|| borrararticulo(tfilas,oBrwt,0,vestanteria) }
:bLDblClick := {|| buscararticulo(tfilas,oBrwt,0) }
:bKeychar := {|nkey| iif(nkey=13 .and. oBrwt:nColSel > 1,buscararticulo(tfilas,oBrwt,0),)}
:lColChangeNotify := .t.
:bChange := { |oBrwt| refrescardatos(vestanteria,oBrwt,0)}
:nFreeze:=1
:lFullGrid := .t.
END
REDEFINE BTNBMP ID 500 RESOURCE "ACEPTAR" OF oddatos ;
ACTION (lSalva:=.t. , oddatos:End());
MESSAGE "Guardar cambios y salir del catalogo" ;
WHEN ( Acceso(oApp:aUsuarios,"ESTANTER", nActua ) )
REDEFINE BTNBMP ID 501 RESOURCE "SALIR" OF oddatos ACTION (lSalva := falso, oddatos:End()) ;
MESSAGE "Salir de Estanteria"
ACTIVATE DIALOG oDDATOS CENTER ON INIT oBrwT:SetFocus()
- Code: Select all Expand view RUN
static function refrescardatos(vestanteria,oBrw,vprofundo)
area:=select()
cdestant := OpenDbf(fdestant,1, , , , kdestant,"DBFCDX")
(cdestant)->(DbSetOrder(1))
(cdestant)->(Dbgotop())
acdestan:=select()
if vprofundo = 0
(cdestant)->(dbseek(vestanteria+transform(oBrw:nRowSel,"9999")+transform(oBrw:nColSel,"9999")+transform(1,"9999")))
if found()
vfcliente:= (cdestant)->cliente
vfnombre := (cdestant)->nombre
vfarticulo:=(cdestant)->articulo
vfdetalle:=(cdestant)->detalle
vfcantidad:=(cdestant)->cantidad
else
vfcliente:= ""
vfnombre := ""
vfarticulo:=""
vfdetalle:=""
vfcantidad:=""
endif
gvfcliente:refresh()
gvfnombre:refresh()
gvfarticulo:refresh()
gvfdetalle:refresh()
gvfcantidad:refresh()
endif
(cdestant)->(Dbclosearea())
select(area)
return nil
Error :
Error description: Error BASE/1073 Error de argumento: <
Args:
[ 1] = C
[ 2] = N 0
Stack Calls
===========
Called from: ../../../tget.prg => TCLIPGET:PUTMASK(0)
Called from: ../../../tget.prg => TCLIPGET:UPDATEBUFFER(0)
Called from: .\source\classes\TGET.PRG => (b)TGET(161)
Called from: .\source\classes\TGET.PRG => TGET:REFRESH(0)
Called from: .\estanter.PRG => REFRESCARDATOS(0)
Called from: .\estanter.PRG => (b)ESTANTERIADATOS(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CHANGE(1274)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:GORIGHT(2785)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYDOWN(2362)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1733)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(12964)
Called from: .\window.PRG => _FWH(0)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(293)
Called from: .\estanter.PRG => ESTANTERIADATOS(0)
Called from: .\estanter.PRG => (b)ESTANTER(0)
Called from: .\jose.PRG => (b)CODBROWSE_NEW(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(638)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(872)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1723)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1705)
Called from: .\window.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: .\window.PRG => TMDIFRAME:ACTIVATE(0)
Called from: .\planman.PRG => MAIN(0)