Siebel VB Language Reference > VB Language Overview >

Data Type Conversions in VB


Numeric conversions. Siebel VB converts data between any two numeric types. When converting from a larger type to a smaller type (for example, Long to Integer), a run-time numeric overflow may occur. This indicates that the number of the larger type is too large for the target data type. Imprecision is not a run-time error (for example, when converting from Double to Single, or from either float type to either integer type).

String conversions. Siebel VB also converts between fixed strings and dynamic strings. When converting from a fixed a string to a dynamic string, it creates a dynamic string that has the same length and contents as the fixed string. When converting from a dynamic string to a fixed string, some adjustment may be necessary. If the dynamic string is shorter than the fixed string, the resulting fixed string is extended with spaces. If the dynamic string is longer than the fixed string, the resulting fixed string is a truncated version of the dynamic string. No run-time errors are caused by string conversions.

Variant conversions. Siebel VB converts between any data type and variants. Basic converts variant strings to numbers when required. A type mismatch error occurs if the variant string does not contain a valid representation of the required number.

No other implicit conversions are supported. In particular, Siebel VB does not convert automatically between numeric and string data. Use the Val function to convert string to numeric data, and the Str function to convert numeric to string data.

Siebel VB Language Reference