Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The most elegant and readable way (and efficient)
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01076714
Message ID:
01076738
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>I'm thinking what would be the best code for this simple task:
>
>I have two records in the table that I'd like to merge. Several fields need to be excluded from the process. I want to take values from the old record and put it into the new record when the old record value is not empty and the new record value is empty. What is the best way to achieve this goal?
>
SELECT OldRecord
SCATTER TO laRecOld
SELECT NewRecord
SCATTER TO laRecNew
FOR i=1 TO ALEN(laRecOld)
  IF NOT EMPTY(laRecNew[i])
    laRecOld[i] = laRecNew[i]
  ENDIF
ENDIF
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform