Bookshelf Home | Contents | Index | PDF | ![]() ![]() |
Siebel eScript Language Reference > About Siebel eScript > About Data Types and Numbers > How Siebel eScript Converts Data TypesSiebel eScript implicitly converts data types in many mixed-type contexts. You must use conversion methods to make sure your code does the required conversions. For more information, see Conversion Methods. Concatenation Can Cause a ConversionSiebel eScript converts the data type of a typeless variable in the following situations:
Siebel eScript must always convert a string to a base 10 number. This string must contain only digits. For example, the following string does not convert to a number because Text is meaningless as part of a number in Siebel eScript: The following examples result in Siebel eScript doing a conversion: s = "dog" + "house" // s = "doghouse", two strings are concatenated. Using a Conversion MethodYou must use a conversion method to make sure Siebel eScript does conversions when it adds, subtracts, or does other arithmetic operations. The following example uses a conversion method to convert a string input to a numeric value: var n = "55"; Use can use the parseFloat method of the global object to specify a more stringent conversion. For more information, see Convert String to Floating-Point Number Method. You must use a conversion method in situations where Siebel eScript does not do a conversion. Siebel eScript includes many global methods that convert data types. For more information, see Conversion Methods. Setting the Data Type Can Cause a ConversionSiebel eScript does conversions differently depending on if the variable is typeless or strongly typed. For more information, see Using Strongly Typed and Typeless Variables. How Siebel eScript Converts a Typeless VariableIf Siebel eScript sets the data type for a typeless variable, then it converts this variable only to another typeless variable. For example, the following examples result in Siebel eScript converting VariableA to a string: var VariableA = 7.2; How Siebel eScript Converts a Strongly Typed Variable Table 5 describes how Siebel eScript converts a strongly typed variable. In this table, assume that Siebel eScript must convert VariableA to VariableB. Table 5 uses the following abbreviations:
|
![]() |
![]() ![]() |
Siebel eScript Language Reference | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |