Page 1 of 1

Chart Text Case

Posted: 21 Apr 2023 18:37
by PRH
I have added relationships to a Relatives chart and changed the format of the names, all good so far.

The relationships are shown is lower case and would like to change it to Initial Captitals!

I can see there are functions to change the text ToLower and ToUpper but nothing on Initial Capitals. I could capitilise the first character of each word but the expression might be a little long/complicated. Hoping there is an easier way that I cant see?

Hope someone can help....

Here is an example of the text (see Relationship):

Re: Chart Text Case

Posted: 21 Apr 2023 19:41
by tatewise
Yes, it will get complex. See Setting a word to sentence-case (21791) which explains how to handle one word!

On top of that, the Section(...) function will be needed to extract each space-separated word.

The following will capitalise just the first letter of the whole relationship:
=Text( ToUpper( LeftText( Relationship( FileRoot(), , TEXT, 1 ), 1 ) ) . MidText( Relationship( FileRoot(), , TEXT, 1 ), 2, 0 ) )

The righthand text is already lowercase so that does need the ToLower(...) function.

Although, thinking about it, in a Text Scheme item the outer =Text(...) function is also not needed:
=ToUpper( LeftText( Relationship( FileRoot(), , TEXT, 1 ), 1 ) )=MidText( Relationship( FileRoot(), , TEXT, 1 ), 2, 0 )

Re: Chart Text Case

Posted: 22 Apr 2023 12:28
by PRH
Many thanks Mike, will have a play......