>Hi!
>
>I have a grid class which allows users to sort any column (asc or desc) by clicking on it. Internally it creates an index on the fly and handles row/table buffering etc.
>
>All this works fine but how do I handle sorting/indexing columns in a table buffered cursor with modified rows (uncommitted changes)?
>
>The users do not want to save the changes first but add, change data, sort on different columns, have a look at the data and then decide if they want to save the changes or not.
>
>I would prefer not to create an index on every column in the table as there are many columns.
>
>Sarosh
this is a dynamic column index with table buffer support,
the only issue is the public variable
CREATE CURSOR dynindex (f1 i,f2 i)
FOR k=1 TO 100
INSERT INTO dynindex VALUES (RAND()*10000,RAND()*10000)
NEXT
g_indexexp = ".T."
INDEX ON EVAL(m.g_indexexp) TAG TCOLUMN
CURSORSETPROP("Buffering",5)
BROWSE NORMAL
g_indexexp = FIELD(1)
REINDEX
BROWSE NORMAL
g_indexexp = FIELD(2)
REINDEX
BROWSE NORMAL