|
|
Expressions Cheat SheetFrom $1Table of contents
Unary operators- — Negation operator, returns the negation of the following numeric value. This only works on numeric values. ! — Logical negation operator Examples
var int32 foo = -5;
var boolean truevalue = true;
Multiplicative operators* — Multiplication, returns the result of multiplying the two sides. Examples
var int32 bar = 24; Additive operators+ — Addition (or concatenation, if either operand is a string) - — Subtraction Examples
var int32 bar = 24; Relational and Equality operators< — Less Than <= — Less Than Or Equal > — Greater Than >= — Greater Than Or Equal == — Equal To != — Not Equal To isa — Tests to determine if a field or variable is a particular type. Note that the type name must be a string enclosed in quotes. Examples
var int32 foo = 42; Using isa with PrimitivesWhen performing isa tests with primitives, you must use sometimes use alternate names according to the following chart
Conditional operators? : — Ternary Conditional, operates like the ternary operator in c/c++ CAVEAT Currently, the inline "if" operator (condition?branch_if_true:branch_if_false) has higher precedence than the concatenation operator. For example, if you have an inline if set to an expression containing true?"true"+"=1":"false"+"=0", then it will evaluate to "true=1=0". The work around is to use parenthesis, for example: true ? ("true" + "=1") : ("false" + "=0") Examples
var int32 second = 24; Logical Operators&& — Logical AND || — Logical OR (||) Examples
var boolean foo = true;
Bitwise Operators& — Bitwise AND | — Bitwise OR Examples
var int result;
Constant Operatorsnull — The constant for a null object reference, similar to a NULL pointer in c/c++. true — The constant for the boolean true value. false — The constant for the boolean false value. today — Returns the current date & time. now — Returns the current date & time. none — Indicates that a dateTime (type) is not set. nonedate — Indicates that a date (type) is not set. luid — Returns a locally unique identifier. guid — Returns a globally unique identifier. Examples
var boolean result; Special CharactersYou can encode special characters using a backslash and letter combination. \t — Tab \n — Line break \n\r — Carriage return This special characters list is incomplete. If you need a code for a special character, you can get help in the Q & A Knowledgebase.
Tags:
|
||||||||||||||||||||||||||||||||||||||||||