Enum ExpressionOptions
- Namespace
- NCalc
- Assembly
- NCalc.dll
Options used for both parsing and evaluation of an expression.
[Flags]
public enum ExpressionOptions : long
Fields
AllowBooleanCalculation = 512Allow calculation with bool values.
AllowCharValues = 4096Parse single quoted strings as char.
AllowNullOrEmptyExpressions = 16384Return the value instead of throwing an exception when the expression is null or empty.
AllowNullParameter = 128Defines a "null" parameter and allows comparison of values to null.
AvoidDynamicFunctions = 68719476736Specifies that Dynamic functions should not be used (required for AOT).
CaseInsensitiveStringComparer = 32Specifies the use of CaseInsensitiveComparer for comparisons.
CompareIncompatibleTypes = 34359738368Specifies that if incompatible types are compared, the comparison evaluates to false instead of failing with an exception
CompareNullValues = 268435456Specifies that comparison of null values should take place (a non-null value has precedence) instead of shortcutting to false.
DecimalAsDefault = 64Uses decimals instead of doubles as default floating point data type.
DontParseDates = 131072Disables parsing of dates for faster parsing
DontParseGuids = 65536Disables parsing of GUIDs for faster processing
HexBinOctAreUnsigned = 134217728Specifies that values expressed as hex, binary, or octal are treated as unsigned values. This has meaning only for the values above long.MaxValue.
IgnoreCaseAtBuiltInFunctions = 2Specifies case-insensitive matching for built-in functions.
IterateParameters = 8Treats parameters as arrays and returns a set of results.
LowerCaseIdentifierLookup = 524288Convert identifiers to lowercase before looking up in the parameter and functions dictionary
NoCache = 4No-cache mode. Ignores any pre-compiled expression in the cache.
NoStringTypeCoercion = 8192Disables coercion of string values to other types.
None = 0Specifies that no options are set.
OrdinalStringComparer = 256Use ordinal culture on string compare.
OverflowProtection = 1024Check for arithmetic binary operation overflow.
ReduceDivResultToInteger = 33554432When enabled and during the Divide operation, there is no remainder to the division, an integer type is used for a result; otherwise, the result is always float (double or extended)
RoundAwayFromZero = 16When using Round(), if a number is halfway between two others, it is rounded toward the nearest number that is away from zero.
SkipLogicalAndBitwiseOpChars = 1048576Disables the use of the ampersand,
|,^,~characters for logical and bitwise operations; opting for AND, OR, XOR, NOT, as well as BIT_AND, BIT_OR, BIT_XOR, and BIT_NOT instead. When this flag is enabled,^is used for powers (together with**)StrictTypeMatching = 32768Enables strict type matching, where comparisons between objects of different types will return false. This also applies to LIKE and NOT LIKE operations - if StrictTypeMatching is enabled, the operands must be strings.
StringConcat = 2048Concat values as strings instead of arithmetic addition.
SupportCStyleComments = 1073741824When set, the parser will recognize C-style line and block comments in expressions.
SupportPythonComments = -2147483648When set, the parser will recognize Python comments in expressions.
SupportTimeOperations = 262144Support math operations (+/-) with DateTime and Timespan and between Timespans
TreatNullAsZero = 536870912When set, null will be converted to zero in math expressions.
UseAssignments = 4194304When enabled, supports assignment statements and update of parameters. By default, the feature is disabled for performance.
UseBigNumbers = 67108864BigInteger is to be used as the last resort when parsing numbers. BigDecimal will be used when dividing two BigIntegers or two BigDecimals.
UseCStyleAssignments = 8388608Enables the use of "=" for assignments and "==" for the equality operator. When not enabled, both "=" and "==" are used for the equality operator and assignment is done with ":="
UseIfStatement = 8589934592When set, recognizes the if() statement, and "if" is not used for a function. When not set, if() is used as an alias to the built-in "iff" function.
UseLoops = 4294967296When set, while() loop statement is supported. The safety fuse, a limit of loop iterations, is set via Expression.MaxLoopIterations/AsyncExpression.MaxLoopIterations. The default value is 65536.
UseNonRecursiveEvaluator = 17179869184When set, the non-recursive evaluator is used. It is slower but enables evaluation of deeply-nested or just very long expressions.
UseStatementSequences = 16777216When enabled, supports sequences of statements separated by ';'
UseUnicodeCharsForOperations = 2097152Enables the use of certain Unicode characters to denote some math operations