Operators

From CEW

Jump to: navigation, search

Contents

NOT

! for NOT is supported by Railo 2 (everywhere) and ColdFusion 8 (cfscript only).

AND

&& for AND is supported by Railo 2 (everywhere) and ColdFusion 8 (cfscript only).

OR

|| for AND is supported by Railo 2 (everywhere) and ColdFusion 8 (cfscript only).

CONTAINS

CT for CONTAINS is supported by Railo 2.

NCT

NCT for DOES NOT CONTAIN is supported by Railo 2.

EXP

EXP for ^ is supported by Railo 2.

Shorthand

ColdFusion 8 and Railo 3.x support the following shorthand operators:

  • x++ for x = x + 1
  • x += y for x = x + y
  • x -= y for x = x - y
  • x *= y for x = x * y
  • x /= y for x = x / y
  • x %= y for x = x % y

Railo 3.1 supports the operator ===. It checks whether a variable is the same instance of another one

  • x === y

Ternary

Railo 3.1 supports the following ternary operator:

  • {condition}?{true-expression}:{false-expression}
  • #boolean?"yes":"no"#
Personal tools