3 Replies Latest reply on Mar 19, 2013 1:51 PM by philmodjunk

    A question about Proper() function

    AndrewCohn

      Title

      A question about Proper() function

      Post

           Hi guys,

           Quick issue I'm having with the Proper calculation function.  I have a Proper(TextFormatRemove ( Self )) calculation on some fields related to addresses in my database.  Works great at preventing lazy data entry.  However, there are some issues with using this function.  If a sales rep enters a string such that contains text such as "S.E." or "SE" for "Southeast" or "H.Q." or "HQ" for "Headquarters" these sorts of entries will also be have their subsequent letters de-capiltzed (eg. "Hq" or "H.q.")

           Is there a way to use a cacluation that will capilizatize words but will not cause de-capitalization on subsequent letters of a word?

           We are using Filemaker Pro/Advanced/Server 11.

           Thanks!

        • 1. Re: A question about Proper() function
          philmodjunk

               I've used the following expression to selectively apply a "proper" format to text:

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

               IF the text is all lower case or all upper case, it applies the proper format, but leaves things unchanged is some capitalization has been applied to the text by the user. It's not perfect and you may want to just do an "exact" test comparing the text to all lower case and not also to all Upper case, but be aware that it's easy for data entry personnel to enter a bunch of text all caps with the caps lock key down.

               You can also use this approach with a conditional format expression instead of a calculation and leave the actual text input into the field unchanged--only changing how it is displayed on a given layout.

          • 2. Re: A question about Proper() function
            AndrewCohn

                 Thanks for the tip, Phil, but it doesn't look like it works quite good enough for me to use.  If you enter "123 fake street" it will change as we would want to 123 Fake Street, but if you enter "123 Fake street" , the correction to capilzation Street will not happen on commit.  (I replaced your "TextField" to "Self" and kept my TextFormatRemove in my implementation.

                 Thanks,

                 Andrew

            • 3. Re: A question about Proper() function
              philmodjunk

                   That is correct, but there is no option that will work perfectly in every situation here. The assumption is that this method catches cases where a user forgets to apply any capitalization but it will not change the data entered if some capitalization was used and some omitted.

                   Also consider such  issues as getting the correct capitalization for names like: MacDaniels.

                   a script or recursive custom function could loop through the text and use this logic while formatting one word at a time however.