Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Notes in the same row
Message
 
 
To
16/04/2007 11:11:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01214141
Message ID:
01216249
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform