Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

move in DBFCDX orders to speed up filters 08 Jan 2020 13:14 #12486

  • wriedmann
  • wriedmann's Avatar
  • Topic Author


  • Posts: 3366
  • Hello,
    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!
    Wolfgang
    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).
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 13:39 #12487

    • robert
    • robert's Avatar


  • Posts: 3595
  • Wolfgang,
    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.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 13:50 #12489

    • wriedmann
    • wriedmann's Avatar
    • Topic Author


  • Posts: 3366
  • Hi Robert,
    that would be great!
    Wolfgang
    P.S. the implicit answer is then that VO cannot do that.... but it seemed to me that Clipper 5.3 could do something like this
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 13:57 #12490

    • wriedmann
    • wriedmann's Avatar
    • Topic Author


  • Posts: 3366
  • Hi Robert,
    another question: the X# RDD currently supports custom orders?
    It is ages that I have not used them, but I think I could need them, combined with the order seek.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 16:31 #12493

    • Karl-Heinz
    • Karl-Heinz's Avatar


  • Posts: 774
  • Hi Wolfgang,

    X# recognizes a VO created custom order and you can already create with X# a custom order, but OrdKeyAdd() and OrdKeyDel() are not working yet. i just tried it in my test app and it still fails..

    METHOD PshAddToCustomOrder() 
    
    
    //	IF DbOrderInfo ( DBOI_KEYADD , , "Order3" )
    		
    	IF SELF:server:OrderKeyAdd ( "Order3" ) 		
    		
    		MsgInfo ( "'" + AllTrim ( SELF:server:FIELDGET ( #last )) + "' added to Custom order 'ORDER3' " ) 
    		
    		
    	ELSE 
    		 MsgInfo ( "OrderKeyAdd() failed" ) 
    		
    	ENDIF 
    	
    	RETURN SELF 
    

    I searched in GitHub and found this in the DbfCdx.prg. Maybe it's on the way ;-)

                    CASE DBOI_KEYADD
                        IF workOrder != NULL
                            info:Result := workOrder:AddKey(SELF:Recno)
                        ELSE
                            info:Result := FALSE
                        ENDIF
                    CASE DBOI_KEYDELETE
                        IF workOrder != NULL
                            info:Result := workOrder:DeleteKey(SELF:Recno)
                        ELSE
                            info:Result := FALSE
                        ENDIF. 

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 16:46 #12495

    • robert
    • robert's Avatar


  • Posts: 3595
  • Wolfgang,
    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.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    move in DBFCDX orders to speed up filters 08 Jan 2020 16:52 #12496

    • robert
    • robert's Avatar


  • Posts: 3595
  • Wolfgang,

    wriedmann wrote: another question: the X# RDD currently supports custom orders?
    It is ages that I have not used them, but I think I could need them, combined with the order seek.


    This is on my todo list. And like Karl discovered, there is partial support for this in the RDD layer but not yet in the Tag layer.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    move in DBFCDX orders to speed up filters 08 Jan 2020 17:09 #12497

    • wriedmann
    • wriedmann's Avatar
    • Topic Author


  • Posts: 3366
  • Hi MrData,

    thank you very much for your anser(s)!

    I don't have any doubts your todo list is huuuuge <g>.
    And I was thinking we could start collecting money for the DBFServer product <g>....

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1