ScriptPro Editor

This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies.

Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint.

 

Mathematical Operations

Mathematical operations perform addition, subtraction, multiplication, and division in an expression.  (An expression is any combination of numbers, variables, and operations that can be evaluated.)

When parentheses are not present, the order of precedence is first multiplication, then division, followed by addition, then subtraction.

Example:  3+2 * 5 = 13

When parentheses are used, the operations in parentheses are evaluated first.

Example:  (3+2) * 5 = 25

Mathematical operations

The four mathematical operations, along with function, syntax and examples of each are listed below. Variables must be numeric.

Operation

Function, Syntax and Example

Multiply

Function:

Syntax:

Example:

Must be a valid mathematical operation.

variable1=(variable2*number)*variable3

a=(b*5)

a=(b*5)*c

Divide

Function:

Syntax:

Example:

Must be a valid mathematical operation.

variable1=(variable2/number)/variable3

a=(b/5)

a=(b/5)/c

Add

Function:

Syntax:

Example:

Must be a valid mathematical operation.

variable1=(variable2+number)+variable3

a=(b+1)

a=(b+1)+c

Subtract

Function:

Syntax:

Example:

Must be a valid mathematical operation.

variable1=(variable2-number)-variable3

a=(b-1)

a=(b-1)-c