Desconozco porque el GRID se comporta de ese modo...
(ademas de que nunca lo he utilizado de esa forma)
Tampoco entiendo el porque querer "hace un BROWSE" a un archivo completo (y de tantos registros)
sabiendo que solo puedo editar un registro a la vez y puedo ir directamente a el.
Desde Clipper, se podía utilizar la función DBEVAL() para filtrar una serie de registros
y poderlos manipular.
A continuación te muestro tu ejemplo modificado... espero te sirva.
*-------------------------------------------------------------------------------------------------------------------------
Hello JA. ??
I do not know because the GRID behaves that way ...
(Besides that I've never used that way)
I do not understand why wanting to "make a BROWSE" to a whole file (and so many records)
knowing that I can only edit one record at a time and I can go directly to it.
From Clipper, you could use the DBEVAL () function to filter a set of records
and be able to handle.
Then I'll show you your modified example ... I hope you serve.
Code: Select all
#include "hmg.ch"
Function Main
*-----------------
LOCAL aCpos := {}
*-----------------
SET EXCLUSIVE ON
SET DELETED ON
use fact new
if !file("fact.ntx")
index on FACT to FACT
endif
set index to fact
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 900 ;
HEIGHT 800 ;
MAIN
@ 0,0 GRID Grid_1 ;
WIDTH 210 HEIGHT 500 ;
HEADERS {"FACTURA","FECHA"} ;
WIDTHS {80,100} ;
ITEMS aCpos
// ROWSOURCE "fact" COLUMNFIELDS {"FACT","FECH"}
*-----------------------------------------------------------------------------------------------
DBEval( { || DoEvent(), Form_1.Grid_1.AddItem( { FACT, FECH } ) }, { || ("A" $ FACT ) } )
*-----------------------------------------------------------------------------------------------
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
FUNCTION DoEvent()
DO EVENTS
RETURN