3 Replies Latest reply on Feb 11, 2014 3:12 PM by philmodjunk

    Case statement woes...

    RichNasser

      Title

      Case statement woes...

      Post

           Long day, no rest and I can't find what's wrong with this case statement that I'm assigning to a variable:

           Case(Get ( TriggerTargetTabPanel )=1;"7";Get ( TriggerTargetTabPanel )=2;"1";Get ( TriggerTargetTabPanel )=3;"2";Get ( TriggerTargetTabPanel )=4;"4";Get ( TriggerTargetTabPanel )=5;"3")

            

           the result is the default which in this case is empty...

            

           probably an easy fix, but I can't see it.

        • 1. Re: Case statement woes...
          philmodjunk

               To make case statements easier to work with, you really need to format them into a form that is easier to read.

               Case(Get ( TriggerTargetTabPanel )=1;"7";
                        Get ( TriggerTargetTabPanel )=2;"1";
                        Get ( TriggerTargetTabPanel )=3;"2";
                        Get ( TriggerTargetTabPanel )=4;"4";
                        Get ( TriggerTargetTabPanel )=5;"3")

               But if you were to look up Get ( TriggerTargetTabPanel ) in FileMaker help, you'll find that this function returns two values separated by a return. You should rewrite this case function to be:

               Case( GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) =1;"7";
                         GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) =2;"1";
                         GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) =3;"2";
                         GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) =4;"4";
                         GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) =5;"3")

               Note: in FileMaker 13, this function is renamed to be: Get ( TriggerTargetPanel ) as it can be used both tab controls and sliders.

          • 2. Re: Case statement woes...
            RichNasser

                 thanks for clarifying.  I went by this FM Help page which didn't mention the two values :

                 http://www.filemaker.com/help/html/func_ref3.33.2.html

            • 3. Re: Case statement woes...
              philmodjunk

                   That's the help page for the CASE function. The problem lies in your use of the Get ( TriggerTargetPanel )  function.