Thursday, October 8, 2009

VBscript vs escript

Recently, I have to write a BS in escript which was
originally written in VB Script. Since Siebel provides a utility to convert the
VB Script to escript but that utility has so many limitations.

Siebel provided utility does only syntactically changes in the
code which is quite helpful when you have huge lines of code to convert. But analyzing
the code is helpful because there can be things which you can do using config,
workflows or BRP.

Limitations of the utility:

Utility does not modify things for the explicit conversions
like Str, CInt, Int if used. Utility does

The differences between Siebel escript and VB Script are as


VB Script



Uses inbuilt function to convert Date to String and vice versa.
For E.g. DateValue, Str, Format


It also uses DateDiff function to calculate the difference of

We need to do scripting for conversion between Date to String
and vice versa.

Also to find the difference of the days you can use a calculated
field or script for finding difference between the Dates.

Function Return Values

Function name = value

Function name = return(value)

Error Hander

Always executed

Only executed if error.

eScript has finally block to destroy objects.





All by ref.

Only Complex Object by ref.


To get the reminder, use ‘mod’


Integer Division

Use back slash ‘\’ for integer division

For every division, use forward slash ‘/’

Script Structure

Function MyFunction() As String

On Error GoTo ErrorHandler



  //variable declarations

  //Program statements are here



//ErrorHandler label and all following code is


//Object destroys from (just the) error handler
are moved here


End Function

function MyFunction()



//variable declarations



//Normal code goes here


catch (e)


//Error code goes here




//Object destroys go here





In escript for
explicit conversion, we can use functions like ToInteger(), ToString().

No comments:

Post a Comment