Page 1 of 1

xbrowse y bseek ¿Cómo se usa?

PostPosted: Wed May 21, 2008 9:16 pm
by fleal
Pues tengo ésta duda... ¿Cómo se usa el bseek para la busqueda incremental en un xbrowse?

No hayo como indicar que la busqueda sea por una columna en especial o hay que activar indices... no sé. Toy perdido :-( El siguiente código marca error aún cuando tengo el indice abierto.

Error description: Error DBFCDX/1201 Workarea not indexed

Stack Calls
===========
Called from: => DBSEEK(0)
Called from: CAPTURA.PRG => (b)VERCATALOGO(2876)
Called from: XBROWSE.PRG => TXBROWSE:SEEK(0)
Called from: XBROWSE.PRG => TXBROWSE:KEYCHAR(0)



// Código que estoy usando

REDEFINE XBROWSE oLbx ID 201 OF oDlg ;
ALIAS "LINEAS" ;
HEADERS "Linea","Nueva Def","Descripción","Producto" ;
COLUMNS "CLINEA","CNUEVADEF","CDESCRIBE" ,"CPRODUCTO" ;
COLSIZES 90 , 90, 200 , 90 ;
ON DBLCLICK ( lPegar := TRUE, oDlg:End() ) ;
AUTOSORT


oLbx:bKeyChar = { | nKey | IF( nKey=13, ;
( lPegar:= TRUE, oDlg:End() ) , FALSE ) }

oLbx:bSeek := {|c| DbSeek( Upper( c ) ) }

PostPosted: Thu May 22, 2008 4:52 am
by Ale SB

PostPosted: Thu May 22, 2008 6:54 am
by Biel EA6DD
Tienes que tener un indice creado en la tabla, para la columna por la que quieres buscar.
Suponiendo que tengas la tabla "LINEAS" indexada por el campo "CDESCRIBE"
Code: Select all  Expand view
oLbx:bSeek := {|c| Lineas->DbSeek( Upper( c ) ,.t.) }

Te recomiendo que le antepongas el alias, y uses el parametro softseek a .t.

Con esto debiera funcionarte.

cierto

PostPosted: Thu May 22, 2008 6:26 pm
by fleal
Ale SB y Biel,

Gracias.
Efectivamente falta el alias

Ahora ya trabaja :-)