Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limit viewed records in curs without losing original cur
Message
From
20/10/2001 11:50:28
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
20/10/2001 00:28:53
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00571259
Message ID:
00571321
Views:
26
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform