1 Reply Latest reply on May 19, 2010 8:46 AM by raybaudi

    Limit total line count

    caskew

      Title

      Limit total line count

      Post

      Is there anyway to limit total line count in a text field?

       

      Even if you limit the number of characters, it does not stop how many lines they have.  You could limit to 20 characters but still have 5 lines.

       

      How do you say:

      Limit to two lines of text , no matter how many characters and hard returns?

       

       

       

      I am using FilemakerPro 8 on a Mac 10.4.11

        • 1. Re: Limit total line count
          raybaudi

          Yes, there is a way ( and better ways with highter version than your ).

           

          1) While in Layout Mode create a two rows field
          2) Look at the Info pannel and write down the field "height" ( Suppose that that number is 35 pixel )
          3) Give to that field an object name ( for example: 1 )
          4) Go in the field definition, tab Auto-Enter and check the "calculated value" with calc:

           

          Let(
          $_height = GetLayoutObjectAttribute ( 1 ; "height" );
          Case(
          $_height > 35 ; "" ;
          Self
          )
          )

           

          5) Uncheck the box: "Do not replace existing value for field ( if any )
          6) Under tab Validation check Validated by calculation and calc:

           

          $_height ≤ 35 & Let ( $_height = "" ; "" )

           

          7) If you want, write down your custm message.

           

          It's all.

           

          Now, if you enter MORE than two lines of text, exiting the field you'll have a validation error and the field will be empty.

           

          Note that I do not remember if your version have the $var and the Self function.