AnsweredAssumed Answered

Custom Function and Quotation mark

Question asked by AA on Dec 5, 2018
Latest reply on Dec 6, 2018 by fmpdude

Hi there,

 

Recently I was searching for a MaxValue FM function. After I realized it does not exist between the native FM functions  but as a custom function. I found one here; FileMaker Custom Function: MaxValue ( theList ; treatAsNumeric ) .

 

Code:

Let([

$__theListToBeComputedByMaxValue = theList;

$__nbLignesToBeComputedByMaxValue = ValueCount( $__theListToBeComputedByMaxValue );
$__maxValueOfTheCustomFunction ="";

computeTheList=
If (
      treatAsNumeric;
      CustomList(1; $__nbLignesToBeComputedByMaxValue ; "if( GetAsNumber ( GetValue ( $__theListToBeComputedByMaxValue ; [n] ) ) > GetAsNumber ($__maxValueOfTheCustomFunction) ; let($__maxValueOfTheCustomFunction=GetValue ( $__theListToBeComputedByMaxValue ; [n]);0) ; 0 )");
      CustomList(1; $__nbLignesToBeComputedByMaxValue ; "if( GetValue ( $__theListToBeComputedByMaxValue ; [n] ) > $__maxValueOfTheCustomFunction ; let($__maxValueOfTheCustomFunction=GetValue ( $__theListToBeComputedByMaxValue ; [n]);0) ; 0 )")

)

];
$__maxValueOfTheCustomFunction

)

 

My question is; How is it possible to put the IF logical operation in a " " - quotation marks? FM should recognize it as a text or not?

Outcomes