Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - aofkeyno() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofKeyNo()
 Returns the current logical record position within the Advantage
 Optimized Filter and within the index scope
------------------------------------------------------------------------------

Syntax

     aofKeyNo( [<cOrder> | <nPosition> ], [<cCDXName>] ) -> numeric

     <cOrder>  A literal filename or character string specifying the
     name of the order. Using the order name is the preferred method since
     the position may be difficult to determine using multiple-order index
      files. If omitted or NIL, the controlling order is assumed.

     <nPosition>  Assumed to be the number representing the position
     of an order in the active index file or specified index file
     (in <cCDXName>). If not a valid order position within the active or
     selected index file, then is assumed to be an index file order. If
     omitted or NIL, the controlling order is assumed.

     <cCDXName>  The name of an index file, including an optional
     drive and directory (no extension should be specified). Use this
     argument with <cOrder> to remove ambiguity when there are two or more
     orders with the same name in different index files.

Returns

     Returns the logical record position which meets the filter condition
     in the system-owned filter and which falls within the scope of the
     current or specified index. Returns zero if unpositioned.

Description

     aofKeyNo() returns the record position which meets the system-owned
     filter condition AND which is within the scope of the current or
     specified index.

     If the current or specified index contains a FOR clause, is UNIQUE,
     or in some other way has fewer than all records for the table
     in it, then aofKeyNo() will be the record position which meets the
     filter condition and is contained in the index.

     aofKeyNo() also obeys the scope on the current or specified index,
     if one exists. So, aofKeyNo() will only use those records which meet
     the filter condition and those that fall within the current or
     specified index scope.

     Note:  When aofKeyNo() is performed, and the system-owned filter
     is only partially optimized, then the filter will be automatically
     resolved into a fully optimized filter before the actual keyno
     operation takes place.  This is to ensure an accurate record number
     is returned.

Example

     INDEX ON age TO age FOR last = 'J'
     INDEX ON salary TO salary

     USE employee INDEX age, salary

     // Create a system-owned filter
     aofSetFilter( "salary >= 75000" )

     // Get the number of records with salary >= 75000 and who's
     //  last name starts with 'J'
     nCnt := aofKeyCount( "age" )

     // Go to the halfway point
     aofKeyGoto( nCnt / 2 )

     // Get the record position of the current record
     aofKeyNo( "age" )


See Also: aofResolvePartial() aofKeyGoto() aofKeyCount()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson