Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The most elegant and readable way (and efficient)
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01076714
Message ID:
01076738
Vues:
13
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform