Bookshelf Home | Contents | Index | PDF

## Redundant Functions in the Clib Object

The Clib object includes the functions from the C standard library. As a result, some of the methods in the Clib object overlap methods in eScript. In most cases, the newer eScript methods should be preferred over the older C functions. However, there are times, such as when working with string routines that expect null terminated strings, that the Clib methods make more sense and are more consistent in a section of a script.

Each Clib method listed in Table 36 is paired with the equivalent methods in eScript. Because Siebel eScript and the ECMAScript standard are developing and growing, the eScript methods are always to be preferred over equivalent methods in the Clib object.

Table 36. Correspondence Between Clib and ECMAScript Methods
Clib Method
Description
eScript Method

abs()

Calculates absolute value

Math.abs()

acos()

Calculates the arc cosine

Math.acos()

asin()

Calculates the arc sine

Math.asin()

atan()

Calculates the arc tangent

Math.atan()

atan2()

Calculates the arc tangent of a fraction

Math.atan2()

atof()

Converts a string to a floating-point number

Automatic conversion

atoi()

Converts a string to an integer

Automatic conversion

atol()

Converts a string to a long integer

Automatic conversion

ceil()

Rounds a number up to the nearest integer

Math.ceil()

cos()

Calculates the cosine

Math.cos()

exp()

Computes the exponential function

Math.exp()

fabs()

Computes the absolute value of a floating-point number

Math.abs()

floor()

Rounds a number down to the nearest integer

Math.floor()

fmod()

Calculates the remainder

% operator, modulo

labs()

Returns the absolute value of a long

Math.abs()

log()

Calculates the natural logarithm

Math.log()

max()

Returns the largest of one or more values

Math.max()

min()

Returns the smallest of one or more values

Math.min()

pow()

Calculates x to the power of y

Math.pow()

sin()

Calculates the sine

Math.sin()

sqrt()

Calculates the square root

Math.sqrt()

strcat()

Appends one string to another

+ operator

strcmp()

Compares two strings

== operator

strcpy()

Copies a string

= operator

strlen()

Gets the length of a string

string.length

strlwr()

Converts a string to lowercase

string.toLowerCase

strtod()

Converts a string to decimal

Automatic conversion

strtol()

Converts a string to long

Automatic conversion

strupr()

Converts a string to uppercase

string.toUpperCase

tan()

Calculates the tangent

Math.tan()

tolower()

Converts a character to lowercase

string.toLowerCase

toupper()

Converts a character to uppercase

string.toUpperCase

 Siebel eScript Language Reference