Document Properties
Kbid2H4752
Last Modified04-Feb-2020
Added to KB20-Jun-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.6
  • ICM 7.7
  • ICM 7.8
  • ICM 7.9
  • ICM 7.10

Reference - ISML Operators

1 Introduction

An operator is a symbol that represents a specific action. For example, a plus sign (+) is an operator that represents addition. Operators are used within ISML Expressions and allow you to manipulate numerical and string values stored as variables or constants. In case one or more operators are not of the required types as described below, a runtime exception will occur.

1.1 References

Reference - ISML Expressions

2 Arithmetic Operators

The standard arithmetic operators are addition, subtraction, multiplication and division. Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value. Arithmetic operators work the same in ISML expressions as they do in other common programming languages.

Note

Division by zero is not defined and will result in a runtime exception.

The examples in the table below assume that var has been assigned the value 2.

Operator

Description

Examples Returning Value 5

+

Addition

var + 3

-

Subtraction

7 - var

*

Multiplication

2,5 * var

/

Division

10 / var

3 Arithmetic Comparison Operators

These operators compare numerical operands and return a Boolean value based on whether or not the comparison is true. The table below shows valid operators.
Operands for arithmetic comparison operators must be classes of type number and their subclasses, e.g., money. The result is of type Boolean.

The examples in the table below assume that var has been assigned the value 2.

Operator

Description

Examples Returning True

==

Equal: Returns true if the operands are equal.

var == 2

!=

Not Equal: Returns true if the operands are not equal.

var != 0

>=

Greater Than or Equal To: Returns true if the left operand is greater than or equal to the right operand.

3 >= var; 2 >= var

<=

Less Than or Equal To: Returns true if the left operand is less than or equal to the right operand.

var <= 5; var <= 2

>

Greater Than: Returns true if the left operand is greater than the right operand.

12 > var

<

Less Than: Returns true if the left operand is less than the right operand.

1 < var

4 Logical Operators

Logical operators are used to build complex expressions that evaluate to true or false.

Type of operands: Boolean; result type: Boolean.

For the examples in the table below assume that variable var_true has been assigned the value of true and var_false the value of false.

Operator

Description

Examples Returning True

AND

Returns true if both operators are true.

var_true AND var_true

OR

Returns true if at least one of the two operators is true.

var_true OR var_false
var_false OR var_true

NOT

Returns true if its single operator is false, otherwise it returns false

NOT var_false

5 String Concatenation Operator

Use the Concatenation Operator to concatenate two strings and return another string that is their union. If an operand is not a string, it is automatically converted into a string.

Type of operands: String, result type: String.

Operator

Description

.

Period: Returns the concatenation of two string operands.

6 String Comparison Operators

These operators compare string operands and return a logical value based on the comparison. The value is equal only if both combined strings contain exactly the same characters. In the case that an operand is not of type string, it is automatically converted into a string.

Type of operands: String, result type: Boolean.

Operator

Description

EQ

Returns true if the two string operands are equal, otherwise false.

NE

Returns true if the two string operands are not equal, otherwise false.

Reference - ISML Reference

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets