iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Chameleon Python API > Value Variable > Python None Object |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Chameleon can utilize the Python None object to represent an empty value variable of any type.
Therefore, the following type-independent if condition may be used to handle empty values:
It is also possible to set the value variable to the Python None object so that Chameleon will flag the field/column as being empty:
In previous versions of Chameleon, there was no special handling of empty values, which meant that empty string values were represented by empty strings "", while empty integers, doubles, and date times were all represented by 0. If your existing Python code assumes that these values are used to represent empty, you can place code at the beginning of each script that sets the value variable. For string values, use the following:
For integer, double and datetime values, use the following:
|