3 Replies Latest reply on Jan 26, 2014 6:18 PM by richardsrussell

    Can Title Case Text Style be Outsmarted?



      Can Title Case Text Style be Outsmarted?


      Setting the text style to Title Case for my database is a great timesaver. However, what am I do to when I have names such as MacDonald or LeHave? At this point I have to make them 2 words (Mac Donald) in order to have the proper lower case and upper case letters, which is not ideal for search purposes or when I merge the data into a letter I'm sending to the person - I don't want to insult them by spelling their name wrong. Can Title Case be outsmarted or am I just better off typing data the old fashioned way?

        • 1. Re: Can Title Case Text Style be Outsmarted?

          You might want to capitalize manually as there is no reliable rule for how these names are capitalized.

          I have played around with the following method, either as a conditional format or an auto-entered calculation. It applies title case only if the text is either all upper case or all lower case.

          Auto enter:

          If ( Exact ( self ; Upper ( self ) ) or Exact ( self ; Lower ( self ) ) ; Proper ( self ) ; self )

          Conditional Format:

          Exact ( self ; Upper ( self ) ) or Exact ( self ; Lower ( self ) )

          Then select Title case for the format for this expression.

          • 2. Re: Can Title Case Text Style be Outsmarted?

            Do not use styles in the layout.

            Instead, use a function to either leave the text as typed or apply the proper style. Use this function as an autoenter calculation


            function name : proper overide

            parameters: text,length           

            Left ( text ; 1 ) = "*";          comment:  if the first charachter is a *
            Trim(Right ( text ; length)); comment: return text minus the first charachter
            Left(text;1) ≠ "*";               comment: if the first charachter is not a *
            Trim(Proper(text));              comment: return the text typed with the proper function applied

            AutoEnter Calculation: Last Name = proper overide(Last Name,length(Last Name)-1)  Comment: the -1 is what strips the *


            If a user types in *MacDonald as the Last Name

            the function will strip the * and return MacDonald.

            Without the star it will return Macdonald (MacDonald with the proper fuction applied)


            A more complicated function could look for a * anywhere in the field and start its work from there.

            An even more compicated function could look for a second * to indicate where its work should end.





            • 3. Re: Can Title Case Text Style be Outsmarted?

                   Rather than set your field up to automatically always do the Proper Case trick, set it up to do it with a script trigger upon exiting the field, except not if you're holding down a modifier key (option, alt, etc.). That'll convert "MACDONALD" into "Macdonald" the first time you exit the field, then you can go back, capitalize the "d", and hold down the modifier key as you exit the field to preserve it.

                   To test for modifier keys:

                   Get ( ActiveModifierKeys ) = 1 or 
                   Get ( ActiveModifierKeys ) > 2
                   dodges around the Caps Lock key, which is sometimes inadvertently left on
                   1 = Shift; 2 = Caps Lock; 4 = Control; 8 = Option; 8 = Alt; 16 = Command
                   These are additive, EG, 5 = shift + control