Conditional visibility of array parameters

mahir
mahir Member, Developers Posts: 1,324 ✭✭✭✭✭
edited November 2017 in FeatureScript
Is it possible to have a parameter array whos individual sub-parameters can be driven by array-level logic? I don't know why, but the below precondition code does not work. I get tagged with an error on the boolean condition of the if statement. It looks like I can't reference individual "arrayVar" parameters. Is there a way to make it work? 

<div>annotation { "Name" : "Array Variables", "Item name" : "Array Var"}
definition.arrayVars is array;

for (var arrayVar in definition.arrayVariables)
{
   annotation { "Name" : "Par1", "UIHint" : "DISPLAY_SHORT"}
   isLength(arrayVar.par1, LENGTH_BOUNDS);

   </div><div>annotation { "Name" : "Par2", "UIHint" : "DISPLAY_SHORT" }<br></div><div>   arrayVar.par2 is boolean;
   
   if (arrayVar.par2)
   {
      annotation { "Name" : "Par3" }
      isLength(arrayVar.par3, LENGTH_BOUNDS);
   }
}</div>

Best Answer

Answers