Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 10:51:27 +0000



Post From: Code help, using a string instead of a constant

[2023-08-27 18:51:06]
j4ytr4der_ - Posts: 938
So yes, InputIndex is the loop counter. Formula is (attempting to be) defined at each repetition of the loop. I posted everything relevant I'm pretty sure, but here's the whole loop.


  bool ParseAndSetFormula = sc.IsFullRecalculation;

  for(int InputIndex = 1; InputIndex <= 16; InputIndex++) // Loop through each input
  {

    const char* Formula = sc.Input[InputIndex].GetString(); // Grab the formula for the chosen input

    for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++)
    {

      double FormulaOutput = sc.EvaluateGivenAlertConditionFormulaAsDouble(BarIndex, ParseAndSetFormula, Formula); // Evaluate the formula
      sc.Subgraph[InputIndex][BarIndex] = (float)FormulaOutput; // Return the formula result in a subgraph

    }
  }

Date Time Of Last Edit: 2023-08-27 19:11:58