Introduction to DScript

About the DScript Language

The programming language you use to build models and Web-based applications in CCH Tagetik Supply Chain Planning is called DScript™. DScript is an enhanced version of the JavaScript® programming language optimized to build decision-support applications. Although DScript uses the same syntax rules as JavaScript, DScript supports a much more powerful set of built-in functions. It also supports a simplified syntax that appeals to users who do not have programming experience.

About ECMAScript

JavaScript was initially developed by Netscape Communications as a programming language for its Navigator Web browser. JavaScript borrowed heavily from the C programming language, but it included modifications that simplified working with untyped data. The language quickly became a standard for Web scripting, prompting Microsoft to develop a version of JavaScript called JScript®. The two implementations were more or less compatible, but had enough differences that a standard was needed to ensure uniformity. This standardization effort was headed by the European Computer Manufacturers Association (ECMA) and was named ECMAScript. DScript is an implementation of the ECMA standard with extensions.

When a Web site developer refers to JavaScript, they are often speaking about the version of JavaScript that includes extensions for client-side scripting in Web browsers. Actually, there is a client-side JavaScript and a server-side JavaScript. Client-side JavaScript includes the core language, as specified in the ECMA standard, plus extensions for controlling a Web browser. The client-side version includes functions that take actions such as opening a new browser window and responding to mouse movements. These functions make no sense in server-side JavaScript. Similarly, there are functions in server-side JavaScript that make no sense in a client-side environment. However, client-side and server-side JavaScript have one thing in common—Core JavaScript.

Core JavaScript deals with the basic syntax of a program, the statements, operators, and other key language components. It is this portion of JavaScript ECMA set out to standardize. DScript also implements this portion of JavaScript with its own extensions that make sense only in a DScript environment. You can take any code written in Core JavaScript, paste it directly into CCH Tagetik Supply Chain Planning, and it functions properly. However, using DScript's extensions, you can probably simplify the code considerably.

About DScript Features

DScript does not support some JavaScript features. In these cases, features were intentionally omitted because they lead to bad programming practices. In addition, there are features of DScript that are not found in JavaScript. These features were added to make it easy to build decision-support applications and to simplify processing of large amounts of data.

Even if you are familiar with JavaScript, you should become familiar with the differences between JavaScript and DScript.

This section contains a number of examples designed to illustrate particular concepts. The examples often contain just a few statements that cannot stand alone.