iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Chameleon Python API > Value Variable > Variable Types |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
In segment scripts, the value variable is always a string. However, in table scripts, the value variable can be one of four possible types:
For Date Time columns, the double value is the number of days from midnight, 30th December 1899. To convert a string representation (as found in the segment scripts) to a double for date time (as used in the table scripts), see the date_time_to_double method defined on the special environment variable. Sometimes in a segment script, you might want to carry out a numeric operation on the value variable. If you try this without converting the value, the Python engine will throw a "TypeError" exception. In order to carry out a numeric operation, you need to use a type conversion function to convert the value variable to a number. Then you have to perform the calculation and then convert it back to a string. For more information on type conversion functions, see String and Number Conversion. |