Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The old EOF() and REPLACE gotcha
Message
From
19/10/1999 13:33:21
 
 
To
19/10/1999 13:03:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00278126
Message ID:
00278326
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform