in order to speed up filter in DBFCDX (both in VO and later in X#), I would like to process only the orders.
To explain it better: I would like to read only the order, without move the record pointer in the DBF, and build a in-memory array of the order values, and then use this array to build filters.
Unfortunately I have not found any function that lets me do that....
Any help would be very welcome!
P.S. if in VO such things are not available, but in the X# RDD, this would be another reason to move to X# (and something I could "sell" to my customers).
This is doable.
I might be able to define a special DBOI_ value to retrieve the list of recno - keyvalue pairs for an index or for a part of an index (if you have set a scope first).
The key values would be represented as byte arrays, and for numeric and date keys these would be encoded just like FoxPro encodes them.
The CDX keys are all stored in Leaf pages. See github.com/X-Sharp/XSharpPublic/blob/mas...ages/CdxLeafPage.prg
I could return a list of a subset of the fields inside CLASS CdxLeaf that you can find in that page. I don't think you need the other properties from that class.
VO (and Vulcan) both have the support to manipulate what is called "RecordLists" inside the CDX RDD.
It has never been documented and brought to the surface.
If you look in volib\Syslib\RDD.PRG you will find a commented out section with DBI_RL_ defines and functions that start with Rl().
You could use this in VO to create recordlists or retrieve the internal recordlist created by the RDD . rlNewQuery() would take an expression and get it evaluated by the RDD and return a new recordlist, there are functions to mark a record as set or cleared in the recordlist and rlNextRecNo() and rlPrevRecNo() find the next and previous record in the recordlist . You can also created multiple recordlists and And or Or them to combine the selected records.
"YouKnowWho" decided that we should not "Unlock" this. You can imagine that MrData would have wanted to do so.