Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 21:23:08 +0000



Post From: how to pass an alert condition to sc.EvaluateAlertConditionFormulaAsBoolean function?

[2019-02-26 17:38:43]
User997668 - Posts: 13
I am seeing the same weird behavior as well....perhaps i am using the new function incorrectly. Here is what i am doing:

I am using AUTOLOOPING + "sc.CalculationPrecedence = LOW_PREC_LEVEL" and evaluating MULTIPLE conditions each time the study is called:


bool ParseAndSetFormula = sc.IsFullRecalculation;

SCString Condition1 = "0"; // sanity check test
int Condition1_result = sc.EvaluateGivenAlertConditionFormulaAsBoolean(sc.Index,ParseAndSetFormula,Condition1);
  
SCString Condition2 = "ID1.SG1 = 0";
int Condition2_result = sc.EvaluateGivenAlertConditionFormulaAsBoolean(sc.Index, ParseAndSetFormula, Condition2);
  
SCString Condition3 = "ID2.SG1 = 0";
int Condition3_result = sc.EvaluateGivenAlertConditionFormulaAsBoolean(sc.Index, ParseAndSetFormula, Condition3);

Condition1_result returns 0 initially then becomes 1 ! The other conditions evaluate to wrong outcomes as well.

I am not sure what I am doing wrong.