Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you explain this replace problem
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00248898
Message ID:
00248959
Views:
13
>* This does not work, no error gets shown, but the replace command
>* does not put anything in the field
>REPLACE prceng.prcpqtyby2t WITH THIS.LIST(THIS.LISTINDEX,1)
>
>* This works
>SELECT prceng
>REPLACE prcpqtyby2t WITH THIS.LIST(THIS.LISTINDEX,1)
>
>Is this a bug, feature, or my misusing a replace on a table that is not selected?


Bret,

What you are seeing is NOT a bug. The replace command is scoped, that is it affects certain records. The scoping for the replace command is controlled by the currently selected work area (except for the situation described below). If there is no table open in the current work area, or the table in the current work area is at eof then there are no records in the scope of the replace command and no replace occurs.

I believe it was VFP 5.0 that added the IN Workarea clause to the replace command; Replace field with vlaue IN Workareaalias. Using this IN clause causes the IN alias to set the scoping for the replace command.
Previous
Reply
Map
View

Click here to load this message in the networking platform