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

    Trim Returns



      Trim Returns


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

      FirstName     LastName




      City   State  Zip


      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

          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

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