Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parse Name to Separate Parts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01219298
Message ID:
01219343
Vues:
20
>Naomi
>
>Thanks for the pointers, that idea really works in my situation:
>
>
>PARAMETERS tcName
>IF PCOUNT()=0
>	lcRefDocName=[CUNNINGHAM LYNNE,]
>ELSE
>	lcRefDocName=tcName
>ENDIF
>LOCAL lcReturn,lcLast,lcFirst,mi,lnLen
>
>lcRefDocName=ALLTRIM(lcRefDocName)
>* Replace any comma with []
>lcNewName=STRTRAN(lcRefDocName,',',[])
>lnWordCnt=GETWORDCOUNT(lcNewName)
>lcLastName=GETWORDNUM(lcNewName,1)
>lcFirstName=GETWORDNUM(lcNewName,2)
>lcMI=GETWORDNUM(lcNewName,3)
>
>lcReturn=[|]+lcLastName+[|]+lcFirstName+[|]+lcMI+[|]
>
>RETURN lcReturn
>
>
What are you doing in case of multiple first names or multiple last names? Such cases are not uncommon. Also can two people be in one field?

BTW, once you get number of words, should you just go in a loop? And I think alines should be a bit quicker than GetWordCount/GetWordNum. You may try to compare speed on the huge files.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform