Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Language Overview > Data Types in Siebel eScript > Implicit Type Conversion in Siebel eScriptSiebel eScript performs implicit data type conversion in many mixed-type contexts. However, to make sure that your code performs conversions as you expect it to, you should use conversion functions that are provided for that purpose, and you should test your code prior to putting it into production. For more information on conversion methods, see Conversion Methods. The rules governing run-time conversion of data types vary and depend on:
Implicit Type Conversion Resulting from Concatenation in eScriptData type conversion of typeless variables occurs implicitly during concatenation involving both strings and numbers and is subject to the following rules.
The following examples illustrate these implicit conversions: s = "dog" + "house" // s = "doghouse", two strings are concatenated. To make sure that type conversions are performed when doing addition, subtraction, and other arithmetic, use conversion methods. The following example uses a conversion method to transform string input to numeric to perform arithmetic: var n = "55"; To specify more stringent conversions, use the parseFloat() Method of the global object. Siebel eScript has many global functions to convert data to specific types. Some of these are not part of the ECMAScript standard. NOTE: There are circumstances under which conversion is not performed implicitly. If you encounter such a circumstance, you must use one of the conversion functions to get the desired result. For an explanation of conversion functions, see Conversion Methods. Implicit Type Conversion Resulting from Assignment in eScriptImplicit type conversion resulting from assignment differ for typeless and strongly typed variables.
|
Siebel eScript Language Reference |