Variable Declarations

Variable declarations are provided to enable you declare the types of any intermediate variables that you use in your scripts.

You are provided with a default variable declaration for the result field of your script, as follows.

vars
    result : String;
begin
    ...                // do some processing here

However, if your script performs complex arithmetic or you want a string result from an arithmetic calculation, you often need to declare a variable to hold an intermediate value, as follows.

vars
    result : String;
    tax    : Decimal[12,2];
begin
    ...                // do some processing here

The variable declarations are displayed when you open the Variable declarations folder in the Commands list box of the Add Script Field or Update Script Field dialogs, as shown in the following image.

The variable declaration (primitive) types are described in Chapter 1 of the JADE Encyclopaedia of Primitive Types.