Pervasive
Sign in | Join | Help
in

Btrieve: What value is ExPc? (In the docs for Get By Percent)

Last post 06-03-2008 1:20 PM by Mike Reynolds. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-30-2008 2:54 PM

    Btrieve: What value is ExPc? (In the docs for Get By Percent)

    The docs say: "To specify a granularity in the Get By Percentage operation

        1. Place ExPc in the second four bytes of the data buffer."

    I can't find any reference to what ExPc is suppose to be on the Pervasive site.

  • 05-30-2008 6:27 PM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

     Is this the right place, or is there a better place to ask a Btrieve question?

  • 06-02-2008 9:01 AM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    It is a string constant you put in the buffer.

    For example, suppose I have the CLASS.MKD file open from DEMODATA.  It has 211 records, and I want to retrieve the 105th record sorted by class name.  I would set up the data buffer with the following hex values in the first 12 bytes:

    69 00 00 00 45 78 50 63 D3 00 00 00

    0x69=105     E  x   P  c   0xD3 = 211
    Percentage


    Then, I would set the DataBufferLength to 12, and the Key Number to 1, and issue the operation 44.  I get back the record corresponding to the class "German 101".

     

     
    Linda

    Linda Anderson
    Pervasive Software, Support
  • 06-02-2008 9:01 AM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    It is a string constant you put in the buffer.

    For example, suppose I have the CLASS.MKD file open from DEMODATA.  It has 211 records, and I want to retrieve the 105th record sorted by class name.  I would set up the data buffer with the following hex values in the first 12 bytes:

    69 00 00 00 45 78 50 63 D3 00 00 00

    0x69=105     E  x   P  c   0xD3 = 211
    Percentage


    Then, I would set the DataBufferLength to 12, and the Key Number to 1, and issue the operation 44.  I get back the record corresponding to the class "German 101".

     

     
    Linda

    Linda Anderson
    Pervasive Software, Support
  • 06-02-2008 6:09 PM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    Apparently, this forum has special reverence for the most knowledgeable support folks -- posts from both Linda and Jose are being double-posted.  Geeked

    Bill Bach
    Goldstar Software Inc.
    www.goldstarsoftware.com
  • 06-02-2008 7:52 PM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    I have a table with 162130 records, but when I try to seek to a particular record number and then count back to the beginning it is off by a considerable margin. Here is a list of values I tried to seek to and the margin of error for where I actually ended up at:

    50->-6
    100->-17
    150->-16
    200->-3
    250->9
    300->17
    350->32
    400->50
    450->68
    500->79
    550->79
    600->87
    650->88
    700->100
    750->96
    800->89
    850->88
    900->89
    950->83
    1000->75
     

  • 06-02-2008 8:19 PM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

     Why are you trying to treat this operation as an "absolute" measure?  All of the documentation refers to this as an "approximation" and that "you should not rely on the accuracy for any other purpose [than a scroll bar]".  The only way to guarantee your own "record number" read is to read all records and index them yourself.

    Bill Bach
    Goldstar Software Inc.
    www.goldstarsoftware.com
  • 06-03-2008 8:39 AM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    Are you seeking along a particular key or in physical order?  If using a key, does it allow duplicate?  If so, are they repeating or linked duplicates?  All of these factors can affect the precision of the outcome.

    Linda

    Linda Anderson
    Pervasive Software, Support
  • 06-03-2008 1:20 PM In reply to

    Re: Btrieve: What value is ExPc? (In the docs for Get By Percent)

    > Why are you trying to treat this operation as an "absolute" measure?

    Because when using the page key to scroll to the top or bottom it is then out of alignment, stopping before reaching the beginning, and repeating the last record at the end of the table over and over again.

    I discovered that FirstDisplayedScrollingRowIndex property gives me enough control over the DataGridView to resync it when it gets close to the beginning or end.

    ===================================================

    > Are you seeking along a particular key or in physical order?  If using a key, does it allow duplicate?  If so, are they repeating or linked duplicates? 

    There are three sort orders, two of the indexes allow duplicates while one does not. I don't know how to determine if they are repeating or linked.
     

Page 1 of 1 (9 items)
© 2008 Pervasive Software Inc. All Rights Reserved.