Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COUNT number of records returned by SET FILTER
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00043256
Message ID:
00043453
Vues:
71
>>reccount will always return the total number of records in the table.
>>use
count to nRecords
like edward suggested to get the number matching the filter
>
>Okay, I understand this will give me the total number of records in the filter, but how do I get the current record number in the filter?
>
>Jeff

Jeff, If I understand, you want to show "Record n of xx" where 'n' is the position IN THE FILTERED SET, and 'xx' is the total count of filtered records.

Getting the total count is easy with COUNT. You'll be starting at record 1, I assume, so just store the value '1' to a form property. When you do a SKIP, or SKIP -1 for next/previous just increment/decrement the value and re-store it. Go Top is 1, Go Bottom is 'xx'. The only problem will be if you do a FIND inside the filter. In this case, you'll have to store the value, go top and count until you get to the record chosen.

Given all this hassle, why don't you use a parameterized view instead of a filter. If you're using VFP5, use the NOFILTER clause, and if VFP3 add a 'nonsense' field to force a cursor not a filtered table. Then your reccount() and Recno() values are always correct.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform