Subject: | |
From: | |
Reply To: | |
Date: | Wed, 29 Sep 2010 11:10:10 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi Emma,
Re-write Paul's CF to be recursive on each "line" of the text field by using the GetValue or LeftValues function to isolate the line and change its value.
Here's a set of custom functions to handle your problem, as I understand it. As always, use with caution (on a backup). There are 2 CFs. The 1st one capitalizes the 1st letter of the 1st word and sets all other characters to lower case; the 2nd CF uses the 1st CF to recursively walk the multiple lines of the text parameter.
// Capitalize1stLetterOnly ( text )
Let(
[
text = Lower( text ) ;
firstWord = LeftWords( text ; 1 ) ;
pos = Position( text ; firstWord ; 1 ; 1 ) ;
char = Middle( text ; pos ; 1 )
] ;
Replace ( text ; pos ; 1 ; Upper( char ) )
)
===
// SentenceCaseByLine( textField )
Let(
lineCount = ValueCount( textField ) ;
Capitalize1stLetterOnly( LeftValues( textField ; 1 ) ) &
Case(
lineCount > 1 ;
SentenceCaseByLine( RightValues( textField ; lineCount - 1 ) )
)
)
Regards,
Jason L. DeLooze
Annapolis, MD USA
|
|
|