This means it's time to get my head around custom functions!

Meanwhile, ValueCount is great, don't know why I didn't spot it. Now I have
the tools I need...

Are you sure custom functions easier than script??

I'd rather not include the Replace in the function, but have it make a new
field, then Replace with the contents of the new field when I'm completely
happy!


On 29/9/10 16:10, "Jason L DeLooze" <[log in to unmask]> wrote:

> 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
>
> --------------------------------
> Inbound email scanned by Mimecast.
> --------------------------------
>

Fourninety Limited

Emma Glaisher
Artworker and Database Development - Fourninety Limited
Tel: 0113 238 2447
http://www.fourninety.com/
The Media Centre, Nepshaw Lane South, Morley, Leeds, West Yorkshire, LS27 7JQ

Media Square plc or any of its subsidiary companies may not be held responsible for the content of this email as it may reflect the personal view of the sender and not that of the company. Should you receive this email in error, please notify the sender immediately and do not disclose, copy or distribute it. While Media Square plc scans all outbound emails for viruses, it cannot be held responsible for any infected files that you may receive. Media Square plc advises all recipients to virus scan any file attachments.

Fourninety Limited, a member company of the Media Square plc group. Registered in England No. 3737606. Registered address 6 York Street, London, W1U 6PL


This email message has been scanned and delivered safely by Mimecast.