2 Replies Latest reply on Mar 28, 2011 12:55 PM by braxton

    Trim Returns

    braxton

      Title

      Trim Returns

      Post

      I am using FM 9.  If I have a group of fields for name, address, etc.:

      FirstName     LastName

      BusinessName

      Address1

      Address2

      City   State  Zip

      Country

      and I want to summarize them in one field where if field data doesn't exist it would automatically delete that line.  How would I do that the easiest and simplest way.

      In the past I have nested "If then" statements.  But, that gets messy after a few options.

      I also just tried the custom function:

      fnTrimReturn (text)

      // removes single line breaks but preserves double line breaks
      // input: text
      // output: text with ¶ line breaks removed

      Substitute ( text ; ["¶¶"; "*#*#*#*#"];["¶";""];["*#*#*#*#";"¶¶"] )

      But, that just puts everything in one line.

      Any help would be appreciated.  Thanks.

        • 1. Re: Trim Returns
          philmodjunk

          LaRetta reminded me of this trick last week...

          list ( FirstName  & " " &   LastName ; BusinessName ; Address1 ; Address2 ; City & ", " &  State &  Zip ; Country )

          This is just a crude example. You may need  more sophisticated expressions for the lines where you have more than one field to handle all possible combinations of empty fields.

          • 2. Re: Trim Returns
            braxton

            Works like a charm Phil.  Thank you so much!!!!