Archive for the ‘eScript’ Category

Unable To Execute VB Script

 

Error Message

Unable to load the scripting extension language DLL ‘sscfbas’!
Scripting was enabled in this instance of Siebel, but the DLL which is needed to implement it could not be loaded.(SBL-DAT-00228)

 

 

Root Cause

I received this error on executing a Client side script written in Siebel Visual Basic (VB) language on a Unix Server. Unix systems does not support VB Script.

 

 

Background

  • eScript is supported by both Windows and Unix systems.
  • VB Script is only supported by Windows systems.

 

Trim leading or Trailing Spaces in Siebel eScript

 

Scenario

 As there is no library function available for trimming leading or trailing characters (like spaces) in Siebel eScript, one need to create a custom function. Following options can be used:

  • Traditional approach – Using While/Recursion
  • Optimized approach – Using Regular Expressions

One can easily design the function with while/recursion, so I won’t discuss that. I will start with the Second approach.

 

Approach 2 : Using Reg Expr

As Siebel escript supports Regular expressions, I will show you how to trim the characters using them:

  • RTrimSpaces (OrgStr) – This function will remove the trailing spaces from the passed string.

function RTrimSpaces (OrgStr)
{
 var Pattern = /\s*$/; //Regular Expression
 var TrimStr = OrgStr.replace(Pattern,””); //Replace with blank
    
 return(TrimStr);
}

  • LTrimSpaces (OrgStr) – This function will remove the leading spaces.

function LTrimSpaces (OrgStr)
{
 var Pattern = /^\s*/; //Regular Expression
 var TrimStr = OrgStr.replace(Pattern,””); //Replace with blank
    
 return(TrimStr);

 

Understanding Reg Expr Used

 Let me explain you elements of the Regular Expressions used in above functions:

  • ‘/’ – Marks the start and end of a pattern
  • ‘\s’ – Matches the whitespace characters like space, tab, new line
  • ‘^’ – Instruct to search at the begining of the string
  • ‘$’ – Instruct to search at the end of the string
  • ‘*’ – Instruct to find zero or more instances

I have used Reg Expr in a specific scenario. But if you want to play around with it, please refer to http://gskinner.com/RegExr/ for additional information. 

Happy Scipting. 🙂