5 Replies Latest reply on Apr 14, 2016 9:21 AM by TSGal

    Script Results can be Text OR ANY OTHER DATA TYPE

    mrwatson-gbs

      (Not being in any ETS program I have nowhere to report this issue other than here ... thus this 'theoretical' issue )

       

      It would be incorrect to specify that the Exit Script step must return a Text Result, because Script Results CAN be of data type Text, Number, Date, Time or Timestamp.

       

      PROOF

       

      This is evident by the following script call:

       

      Script "Test Script Result Type"

      Perform Script [ "Return 44" ]

      If [ 5 > Get( Script Result ) ]

      Show Custom Function [ "5 is bigger than 44? => Script Result is a text" ]

      Else

      Show Custom Function [ "5 is NOT bigger than 44 => Script Result is a number" ]

      End If

       

      Script "Return 44"

      Exit Script [ 44 ]

       

      IFF it were true that script results are always text results then running the Test Script would show the message "5 is bigger than 44? => Script Result is a text"" - which is true of string comparisons - which occur when any one of the operands are of type text. (5 > "44" = "5" > "44" => 1)

       

      HOWEVER running the Test Script shows the message "5 is NOT bigger than 44 => Script Result is a number" (5 > 44 => 0)

       

      PROVING that Script "Return 44" does NOT return a TEXT result, but a NUMBER result

       

       

       

      ...So one should consider that it might be confusing to developers if FileMaker suggested that script results are ALWAYS TEXT. Any such suggestion is an ISSUE and should be aborted before birth, if possible.

       

      Serving you as best I can.

       

      MrWatson