Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compare fields between 2 records of a cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01538081
Message ID:
01538449
Vues:
45
>>>I need to compare a subset of fields in two records of the same cursor to create output where record1.field not equal record2.field. The best way I can think of is to scatter fields from each rec to separate arrays then do a for ... next loop comparing the values and kicking out field names from a matching array of the ones that are different.
>>>
>>>I already know some will always be different so sys(2017) won't help here. I thought there was another function to compare fields but I can't remember or find it. (It's Monday.)
>>>
>>>Anyone got a better idea?
>>
>>As Validimir suggests, try scattering to name and then compare objects.
>
>The problem is that COMPOBJ() compares the entire array/object (as I read the doc anyway). I need to compare each individual field. I already know some of the fields will be different.

In such case you can scatter to name excluding the fields you don't want to test. See EXCEPT clause of the SCATTER command.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform