2 Replies Latest reply on Apr 29, 2016 2:56 AM by Extensitech

    Searching in a ListLayout

    Stigge

      Hi

       

      Am sure this is super simple! But i just cant get my head around it ! =D

       

      Am trying to search records that are Above one number and below another. A scope of ID. in a script.

       

      Start ID = 0020  (text)

      End ID = 0040  (text)

       

      Total amont of record ID´s = 0001 to 9999  (text)

       

      All i want is to list them, thats it.. :/

      Anyone who can fast and easy answer me on this really simple issue that frustrates my day right now =D

       

      Thank you !

      /Stigge

        • 1. Re: Searching in a ListLayout
          Stigge

          Solved it myself..

           

          Dont know if its the best solution.. =D but it does the jobb. =D

           

          • 2. Re: Searching in a ListLayout
            Extensitech

            Use an ellipsis to find a range, i.e. 0020...0040. In your script, you can set field [ Home::ID ; $StartID & "..." & $EndID ]

             

            You may find this helpful: FileMaker Power Finds | Extensitech

             

            Incidentally, if you haven't already, you may also want to learn the Case function, rather than nested If functions.

             

            Finally, and also incidentally, if you have FMP Advanced, you can use the following custom function to create fixed-width text strings, it accepts original text (or number), the number of characters you want, and the fill character you want to use ("0"). If you enter a negative number in numCharacters, it fills left, for positive it fills right.

             

            //x_txt_fill ( text ; numCharacters ; fillCharacter ) =

             

            Let ( [

            text = Left (  text ; Abs ( numcharacters ) ) 

            ; paddedtext =

                      Case (

                           numCharacters > 0

                           ; text & fillCharacter

             

                           ; numCharacters < 0

                           ; fillCharacter & text

                 ) 

            ; missingCharacters = Abs ( numCharacters ) - Length ( text )

             

            ] ;

             

            Case (

                 missingCharacters = 0

                 ; text

                 ; x_txt_fill ( paddedtext ; numCharacters ; fillCharacter )

            )

             

            )

             

            HTH

             

            Chris Cain

            Extensitech

            1 of 1 people found this helpful