Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Limit viewed records in curs without losing original cur
Message
De
20/10/2001 11:50:28
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
20/10/2001 00:28:53
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00571259
Message ID:
00571321
Vues:
27
>I have a cursor I use through out an app. At times, I would like to narrow the rows displayed (in my grid) to records in the cursor that meet a specific qualification and ideally, I don't want to lose the original rows in the cursor (due to some recno() references etc)... just not see them. Is there a way to do that without reselecting the cursor?

Alternately, if you don't want a filter (which gets reevaluated for each visible record on each refresh of the grid), you can create a filtered index on the cursor:
index on {expression} for {filter expression} tag whatever of {cdxFileName}
The "of {cdxFileName}" is recommended, because if you have a read-only cursor, you can give it only one tag without it; if you try a second one, it complains about being read-only. But that holds only for the structural index, i.e. the one which has the same filename as the table. Use your favorite random name generator to create this filename. In VFP7, you can create the cursor as ReadWrite; in VFP6 you can use the regular
Use (dbf("cursoralias")) again in 0 alias NewAlias
trick to make the cursor read-write. If it's read-write, you can index it any way you like. In your grid, just set the order of your cursor to this tag and there you are. Make sure you issue a locate or any other record movement between indexing and refreshing the grid, just to make sure you're not sitting on an invisible record (maybe this is not needed at all, but just in case).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform