3 Replies Latest reply on Jul 17, 2017 4:05 AM by Markus Schneider

    parameters for a custom function

    barand

      Dear Filemaker users,

       

      I want to use the following cf: FileMaker Custom Function:DeleteValue ( list ; index )

       

      But I cannot use "list" as a parameter. How can I fix this problem?

       

      Kind Regards,

       

      Baran

        • 1. Re: parameters for a custom function
          fmpdude

          Hmmm, the documentation and examples on the page you referenced both imply a list as an input parameter:

           

          Syntax: DeleteValue ( list ; index )

           

          Maybe you can supply more about what you tried including your script or CF code?

          • 2. Re: parameters for a custom function
            coherentkris

            change list to _list ( or anything else for that matter ) as a parameter AND in every usage in the function and it will work.

            /* --------------------------------------------------------------------------------

            Returns a list with value at position 'index' removed

             

            Syntax: DeleteValue ( _list ; index )

             

            In: list - the return delimited list to search

                  index - the position (1-...) of the value to delete

             

            Return type: Text (a list with leading and trailing returns removed)

             

            DeleteValue ( "John¶Paul¶Brian¶George¶Ringo" ; 3 )   --> "John¶Paul¶George¶Ringo"

             

            Theo Ros

            -------------------------------------------------------------------------------- */

             

            Let ( [ _list = LeftWords ( list ; 999999999 ) ;

                       totalvalues = ValueCount ( _list ) ] ;

              Case ( index < 1 or index > totalvalues ; _list ;

                LeftWords ( LeftValues ( _list ; index - 1 ) &

                                    MiddleValues ( _list ; index + 1 ; 999999999 ) ; 999999999 )

              )

            )

            1 of 1 people found this helpful
            • 3. Re: parameters for a custom function
              Markus Schneider

              'list' is a reserved internal function of FileMaker - but also used for 'list of values'. Just use any other name as coherentkris mentioned or something like 'MyList'