- Tony Fahlberg
- SnapObjects
- Wednesday, 4 March 2020 09:12 PM UTC
Hi - I was using the IDataStore.Evaluate method on an expression with a condition and it appears that the true and false conditions get evaluated before returning the correct value. Is this expected behavior?
For example, the below generates an error with the Lower method (BUG 4137) if colInitials is NULL but since the condition was not met I did not expect the Lower method to be performed.
if(isnull(colInitials), \"\", Lower(colInitials))
Another example was where I used DwFunctionManager.AddGlobalFunction<TClass>() to inject a class which contains custom PB functions (static methods). I am then using these functions in an expression when using IDataStore.Evaluate(). Placing breakpoints in these global functions I see that both the true and false conditions get evaluated before returning the correct value.
If(colTest=\"Y\", myFxn1(colName), myFxn2(colName))
I could not determine if this also occurs with DWCompute since it does not have the same issue with NULL column values and currently cannot use custom functions (static methods).
Thoughts?
Thanks, Tony
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.