Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stripping
Message
De
09/04/2008 11:32:50
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01309362
Message ID:
01309378
Vues:
6
So, run this for each word in the name instead of the whole name? Yeah, but that assumes that prefix is always in the beginning and suffix is always at the end. It's not always the case. "Proffler, Mr., Droopy" would not work. Maybe I'll just drop "Master" from the list.

>What if somebodys name is 'Master'? You should parse full name first.
>
>>This isn't quite right. It replaces things like portions of tcName that I don't want it to. It strips the "Mr" but also the "Dr" and "Prof" portions. I think I have to do something more with the GetWordNum, but can't quite get it to work. Any help (yours, not the Foxpro) is appreciated.
>>
>>
>>tcName = "Mr Droopy Proffler"
>>
>>* Strip common name prefixes.
>>m.ReplaceWith = ''
>>m.PrefixSearchString = [ MR MRS MS MISS DR PROF SIR MASTER REV REVERAND ETC ]
>>FOR x = 1 TO GETWORDCOUNT( m.PrefixSearchString )
>>	m.LookFor = ALLTRIM(UPPER(GETWORDNUM(m.PrefixSearchString,x)))
>>	tcName = CHRTRAN(UPPER(tcName),m.LookFor,m.ReplaceWith)
>>ENDFOR
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform