2 Replies Latest reply on Nov 8, 2012 7:59 AM by PeteTheFreeze

    Weird behaviour of script with custom function

    PeteTheFreeze

      Title

      Weird behaviour of script with custom function

      Post

           Hi all,

           Using FMPA 11, I added a custom function (DeDupe(startstring;valuelist)) to a database hosted with FM Server 10.0.1.64. This works fine when I use it on my windows laptop. A friend used it on his mac with FMP 10 and as soon as the script using the custom function had to print the list of values (using kargas' Dialog_PlugIn) in a drop-down-list-dialog, he got the message "the maximum of licensed users are currently using this ..., etc." and got kicked out. He is able to see the custom function in the manage custom function-part of the database and it seems perfectly fine.

           I replaced the custom function Dedupe by the custom function RemoveDuplicate(Text) and again it works fine on my comp, but he gets kicked out. (He does not get kicked out when I remove the custom function from the script, BTW, so the Dialog_PlugIn seems to work properly.) Nobody else is logged in, so to me it is totaly unclear where the license conflict message is generated.

           I am now at the point of despair and want to leave custom function behind. But maybe someone here has got a suggestion for me.

        • 1. Re: Weird behaviour of script with custom function
          JimMac

               I will try to help.smiley

               In searching for the problem you have explained many differences, but are focused on the custom function.  What gives you that conclusion?

               If you are sure, post the custom function.

               That error message appears when FMP detects to many copies of FMP Advanced too.  Who is using Advanced?

               Does the Mac user have Advanced?

          If so...

               Wait at least 1 or 2 minute from one FMP Adv, logging off and the other logging in to your server.  FMP is doing a license check in the background tasks.

               Jim...

                

          • 2. Re: Weird behaviour of script with custom function
            PeteTheFreeze

                 Thanks Jim for your reply.

                 I decided to avoid the custom function altogether and use FilterListItems with a value list instead. The reason I wanted to use the custom function to get rid of duplicates in a List() is that I thought it was easier. Turns out FilterListItems is just as easy and saves me a lot of trouble.

                 Still I am curious about the problem. To answer your question, I am using FMP Advanced 11, the mac user is on FM Pro 10. The function DeDupe is to be found here: http://www.briandunning.com/cf/186 . RemoveDuplicates here: http://www.briandunning.com/cf/492 .

                 I am pretty sure it was due to the custom function that the mac user got kicked out, because when I did not use it and just used the List()-generated list it worked.

                 So this:

                 Set Variable[$List; Value: Substitute(List(Table::Field); "¶"; "|") & "|"]

                 Set Variable[$Temp; Value: Dialog_SetInputTypes("combobox"; "";"";"";"";"";"";"")]

                 Set Variable[$Temp; Value: Dialog_SetDefaultInputs($List; "";"";"";"";"";"";"")]

                 Set Variable[$Result; Value: Dialog_DoDialog("";"Dialog title";"Choose from the list below";"OK";"Cancel";"";"";"";"";"";"")

                 shows a drop-down list in a dialog for both me and my friend.

                 When I use the custom function in the first script step he gets kicked out (regardless of me being on the server or not; and I did wait 2 min.)

                 So this doesn't work for him:

                 Set Variable[$List; Value: Substitute(DeDupe("";List(Table::Field)); "¶"; "|") & "|"]

                 And this doesn't work for him:

                 Set Variable[$List; Value: Substitute(RemoveDuplicates(List(Table::Field)); "¶"; "|") & "|"]

                 Weird...