Example of Using a Script Library

In the following example, the mathService business service is enabled for use in Web Tools. It uses a business service method named square:

function square (x)
{
  return (x * x);
} 

If you use a script library to call an argument, then the compiler examines the argument types to make sure the argument that your script calls is valid and is compatible. The following code calls a business service method named square:

var oBS: Service = TheApplication().GetService ("mathService");
var value = 10;
var square_value = oBS.square (value);