>>>>>Hello,
>>>>>
>>>>> How to find the position of a record in an indexed table.
>>>>>RECNO() will give the position of the record in the table but how to find the position in an indexed table.
>>>>>
>>>>>TIA
>>>>
>>>>For Versions of VFP previous to 9, if the table is small (under 65,000 rows), you could do a SQL SELECT of the primary keys into an array in the order of the index key. Then do an ASCAN to find your primary key. The element of the array would be the indexed order.
>>>
>>>Fred! That's brilliant!
>>>
>>
>>Sure ?
>
>It is a great concept.
>
no, it is useless.
>>ASCAN is equal to a ordered count
>
>Yes.
>
>>
>>>You could expand that to a cursor! select pk order by indexkey. locate for pk = m.pk
>>>
>>
>>If you want gain something:
>>
>>SELECT pk from table order by 1 ...
>>INDEX ON pk tag tagpos
>>SEEK m.pk
>>? recno()
>>
>
>Only if the index is used in several subsequent seeks.
>
without the index, this solution is useless
>>
>>>recno is then the relative position.