Hi,nguyenchiduc wrote: I do not understand "virtual grids" what is but I have a test for my database. And the result is very good for any file .dbf with any capacity.
when someone posts some code I'm always happy because I can learn how other people solve problems.
And you did a smart thing... you copy a subset of the master (probably big) file into a temporary file so that the grid actually moves inside this really small dbf....
very clever indeed !
Browsing your code I found a little code snippet that can be optimized...
This code:
Code: Select all
FOR i := 1 to k
command := "temp->" + FIELDNAME(i) + ":= " + "data->" + FIELDNAME(i)
&command
NEXT
Code: Select all
FOR i := 1 to k
temp->(fieldput(i,data->(fieldget(i))))
NEXT
recently fieldput and fieldget were extended to accept the fieldname as first parameter, instead of a numerical field position
fieldput( fieldpos("field"), "value" ) can also be written as fieldput( "field", "value" )
I think that the loop can be a bit optimized too and moved to a function but it depends on coding style.
Francesco