4 Replies Latest reply on Mar 22, 2011 4:14 PM by philmodjunk

    Can I "Slide up" in a text Calculation?

    DanaStites

      Title

      Can I "Slide up" in a text Calculation?

      Post

      I have a calculation for a label that looks like this:

      If ( Ship Dub 1 Network  >0 ; "LOGO"  & ¶ &
      Program Info::NielsenProgramTitle & " " & EpNumber & ¶ &
      EpisodeTitle & ¶ &
      Fight Info & ¶ &
      "Tape 1 of (insert)")

      Problem is, sometimes EpisodeTitle field is blank.   If that is the case, I want to "slide up" everything underneath.   I know how to slide on a layout, but not in a calculation.  I looked at "Is Empty" but dont think that is what I want.   I also tried to add "If EpisodeTitle >0, but that wipes out everything below if empty.  Any suggestions?

       

       

        • 1. Re: Can I "Slide up" in a text Calculation?
          philmodjunk

          You can certainly set this field to slide up but the carriage return created by & ¶ & is still there and will create a blank line even when the field is set to slide.

          Modify your calculation like this:

          If ( Ship Dub 1 Network  >0 ; "LOGO"  & ¶ &
          Program Info::NielsenProgramTitle & " " & EpNumber & ¶ &
          If ( Not IsEmpty ( EpisodeTitle ) ; EpisodeTitle & ¶ ) &
          Fight Info & ¶ &
          "Tape 1 of (insert)")

          That way, the extra return is not included unless EpisodeTitle is not empty.

          • 2. Re: Can I "Slide up" in a text Calculation?
            DanaStites

            Simply brilliant, that worked!   THX

            • 3. Re: Can I "Slide up" in a text Calculation?
              LaRetta_1

              Remember to take advantage of the List() function when you want to list items and have blanks lines removed.  See if this might be easier to work with.  It protects from multiple possible blank lines without need of multiple IsEmpty() tests:

              If ( Ship Dub 1 Network  > 0 ;
                 List ( "LOGO" ; Program Info::NielsenProgramTitle & " " & EpNumber ; EpisodeTitle ; Fight Info ; "Tape 1 of (insert)"  )
                )

              ... and no, LOGO and "Tape 1 of..." don't need to be within the List().  I included them for visual point and personally I would include them in List().  It just makes it cleaner to read and the purpose and structure are more clear.

              • 4. Re: Can I "Slide up" in a text Calculation?
                philmodjunk

                Good point! The other option that is sometimes a good idea is to not use any calculation, just place the fields on the layout and set them to slide up. That's a "print/preview/pdf only" solution, but it has its uses in some cases.