Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Filter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01654550
Message ID:
01654554
Vues:
53
>>>Hi,
>>>
>>>I am going back in time :)
>>>
>>>I need to - temporarily in IDE - process some records of a .DBF table. I need to see only records that meet certain criteria. For example where some field is EMPTY. If I use SET FILTER TO I see there records but as soon as I make an entry in this field, the record is gone (because it is no longer matching the SET FILTER). How can I make these records, initially selected with SET FILTER TO stay on the screen so I see what entries I made? I need a quick a dirty approach, not views and other approaches. Possible?
>>>TIA
>>
>>You could create a cursor with a field an index, like:
>>
>>
>>create cursor c_filtered (RecordNr I)
>>index on RecordNr tag RecordNr
>>
>>
>>First you populate the cursor with all the records that comply the filter, then in your filter you add
>>
>>({your old condition}) or indexseek(recno('YourAlias'), .f., 'c_filtered', 'RecordNr'))
>>
>>Notice the parenthesis surrounding your old condition
>
>Thank you, Hugo. Let me clarify.
>The cursor c_filtered would only have 1 column and I have to add to this cursor every record number that match the filter of the "target" DBF, correct?
>
>Then, I don't understand the second part. I am sure it is just me and my tired brain (I have been crunching records ALL day).

Ah, there is a reason you do not understand, I had a second use for the table, but I could not finish my message and mixed things, sorry about that.

If you populate your cursor with the records that match the filter condition at the beginning, then you are right, your filter can only be set to the indexseek part, without using your old conditions at all.

The thing is that in my head I was also thinking that if you start with an empty cursor and only add the record numbers that you modified, then if you use the filter with the OR as I put it in my first message, but also you can keep track of the records that you have changed, you could, for example, have a different back color for the rows that have original values

Hope this is more clear...
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform