Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The old EOF() and REPLACE gotcha
Message
De
19/10/1999 13:33:21
 
 
À
19/10/1999 13:03:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00278126
Message ID:
00278326
Vues:
17
Hi Erik,

Oh, I know it's by design, that's why I call it a "gotcha". It's just counterintuitive when it happens.

I don't always use the IN clause on replace. It "feels" redundent when specifying the alias.field means of addressing what is to be replaced.


>Believe it or not, though annoying, this is one of those that qualifies as "By design"
>
>A REPLACE statement takes two optional clauses: a FOR clause, and an IN clause.
>
>If you leave out the IN clause, the replace assumes it is working on the current alias. If you leave out the FOR clause, the replace assumes it shall execute the command once for the current record in the current alias (as opposed to once for every record in the current alias that meets the specified condition). So, if you leave out the IN clause, VFP operates on the current table, and if the current table does not have a current record (EOF()), the command will not execute.
>
>Call it a bug if you will, but this "bug" won't ever be fixed.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform