Wiki

Clone wiki

DWScript / Operators

  1. summary Supported operators

Operators

Unary operators

-Negation
notLogical or bitwise NOT
@Explicit function pointer reference

Expression operators

+Addition & string concatenation
`-`Subtraction
`*`Multiplication
/Division (floating-point)
divEuclidean division
modRemainder of Euclidean division
sarBitwise shift arithmetic right
shrBitwise shift right
shlBitwise shift left
inPresent in an array, set, or substring in a string
not inAbsence in an array, set, or substring in a string
andBoolean or bitwise AND
orBoolean or bitwise OR
xorBoolean or bitwise XOR
impliesLogical IMPLIES
isClass, interface type test
asClass, interfaces safe cast
implementsTests if a class implements an interface
=Equality test
<>Difference test
<Lesser test
<=Lesser or equal test
>Greater test
>=Greater or equal test

Ternary operators

if .. then ..Conditional value or default value
if .. then .. else ..Conditional value with alternative

Assignment operators

:=Assignment
+=Addition & concatenation compound operator
-=Subtraction compound operator
`*=`Multiplication compound operator
/=Division compound operator

Available operators

Those operators don't have a language-defined meaning, but can be overloaded.

<<
>>
^

Updated