Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Notes in the same row
Message
 
 
À
16/04/2007 11:11:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01214141
Message ID:
01216249
Vues:
17
>Hi Olaf,
>
>Thank you so much for the code you gave me. I used the second code without index and it works perfectly. Is there a way that I could get rid of .NULL. on my notes and just leave it blank if there is no notes? Please help. Thanks, Sam
>
>
>* updating parent records
>Select curParent
>Scan
>   lcNotes= ""
>   Select curChild
>   Scan For curParent.iid = curChild.iid
>      lcNotes = lcNotes + Alltrim(curChild.cNote) + " "
>   Endscan
>   Replace mNote With lcNotes In curParent
>Endscan
>
Hi Sam,

Just check for empty or null memo in the loop, e.g.
>* updating parent records
>Select curParent
>Scan
>   lcNotes= ""
>   Select curChild
>   Scan For curParent.iid = curChild.iid
       if not empty(curChild.cNote) and not isnull(curChild.cNote)
>         lcNotes = lcNotes + Alltrim(curChild.cNote) + " "
       endif
>   Endscan
>   Replace mNote With lcNotes In curParent
>Endscan
BTW, it's a bit funny. We gave you the same algorithm multiple times in this thread and you could not make it work because of the wrong index, I guess.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform