3 Replies Latest reply on Aug 8, 2016 4:19 AM by TomHays

    Min Function with a local variable


      I have a script that collects a series of numbers in a local variable (I'll call it $n).  There is a looping process so I gather the numbers in a horizontal list.  The end result looks like this:




      That list is created in a variable $nList via a calculation:


      If (

        not Isempty ( $nList ) ;

        $nList & ";" GetResults ( "n" ) ;

        GetResults ( "n" )



      The GetResults ( "" ) is a custom function from Six Fried Rice for passing key;value parameters.  In the Data Viewer, $nList is defined as 40;12;17.1428571428571429, as expected.


      I want to get the lowest number in the list so I then create a new variable, $nListLowest:


      Min ( $nList )


      However, it evaluates as a question mark (?).


      I modified the $nList calculation to make sure the passed variables are numbers:


      If (

      not Isempty ( $nList ) ;

      $nList & ";" GetAsNumber ( GetResults ( "n" ) ) ;

      GetAsNumber ( GetResults ( "n" ) )



      But that produced the same result.


      In the Data Viewer, I can copy the result of $nList and make a new Watch expression:


      Min ( 40;12;17.1428571428571429 )


      That returns 12, as expected.


      I suspect the $nList variable is a string and cannot be evaluated by the Min () function.


      Any thoughts?