I've only just been introduced to FoxPro, so I'm not sure how it optimizes..
I have to do a blanket update to some fields for all records in a table, and then a record-by-record update of some fields based upon certain logic.
I see 2 ways of doing this:
1/
Use a REPLACE .. ALL command for the blanket updates
Then a SCAN..ENDSCAN loop with the logic inside for the record-by-record updates.
2/
Putting everything inside the SCAN..ENDSCAN loop, and modifying the REPLACE command to include the fields I previously put in the REPLACE ALL command.
Method 1 seems (to me) to break out better logically (ie. Do THIS to the entire table, and then work out THAT with each record), but I'm aware that I'd be scanning the table twice.
What's the accepted 'wisdom' on this issue ?
I have to do a blanket update to some fields for all records in a table, and then a record-by-record update of some fields based upon certain logic.
I see 2 ways of doing this:
1/
Use a REPLACE .. ALL command for the blanket updates
Then a SCAN..ENDSCAN loop with the logic inside for the record-by-record updates.
2/
Putting everything inside the SCAN..ENDSCAN loop, and modifying the REPLACE command to include the fields I previously put in the REPLACE ALL command.
Method 1 seems (to me) to break out better logically (ie. Do THIS to the entire table, and then work out THAT with each record), but I'm aware that I'd be scanning the table twice.
What's the accepted 'wisdom' on this issue ?