blanksAsZero
The blanksAsZero build descriptor option controls what happens when you assign or compare a text variable to a numeric variable.
In the simplest case, if the value of the blanksAsZero option is YES and you assign a text value that contains all blanks or all hexadecimal zeroes ("low values") to a numeric variable, the result is zero. The default value is NO.
The option also applies to comparisons. Results can be further
affected by the value of the v60NumWithCharBehavior build
descriptor option, as shown in the following table:
| Value of blanksAsZero | Value of v60NumWith-CharBehavior | Text source (blank or "low values") | Numeric target | Results |
|---|---|---|---|---|
| n/a | YES | CHAR | NUM | v60NumWithCharBehavior takes
priority:
|
| NO | NO | CHAR | NUM | v60NumWithCharBehavior does not apply. The text value is not valid in a numeric assignment or comparison, so EGL throws an exception. |
| YES | NO | CHAR | NUM | v60NumWithCharBehavior does
not apply.
|
| NO | n/a | Any other combination of text source and numeric target types | v60NumWithCharBehavior does not affect these types. The text value is not valid in a numeric assignment or comparison, so EGL throws an exception. | |
| YES | n/a | Any other combination of text source and numeric target type | v60NumWithCharBehavior does
not affect these types:
|
|
The blanksAsZero build descriptor option does not affect the assignment of a text value that is null to a numeric variable. If the source is null, a numeric target variable that is defined as nullable takes a null value; a numeric target variable that is not defined as nullable is set to 0.
Values
- YES
- Treats a text value that is all blanks or low values as though it is zero when assigning or comparing the text value to a numeric variable.
- NO (the default value)
- Throws an exception when you assign or compare a text value that is all blanks or low values to a numeric variable.
For more information, see the table in this topic.