Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROPER case for sentences
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00184375
Message ID:
00184384
Vues:
17
>I'm in need of something that will take misc. text in a memo field and adjust it's case to be correct for sentences. As far as I know VFP will either put it in all upper case or all lower case or capitalize the first letter of each word. ... I need the equivalent of PROPER(), but one that is sentence based.
>
>Anybody know of something I can use? Did I miss something in VFP that does this?
>
You may use this code as function
cString=" use it as parameter to function. hopefully it will work."
cNewstring=""
lCapitalize=.T.
FOR n=1 to len(cString)
	cChar=substr(cString,n,1)
	IF empty(cChar)
		cNewstring=cNewstring+cChar
		LOOP
	ENDIF
	IF lCapitalize=.T.
		cNewstring=cNewstring+upper(cChar)
		lCapitalize=.F.
		LOOP
	ENDIF
	IF asc(cChar)=46
		lCapitalize=.T.
	ENDIF
	cNewstring=cNewstring+cChar
ENDFOR
=messagebox(cNewstring)
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform