|Top Previous Next|
The operators available in FreeFlyer can be broken up into assignment operators, mathematical operators, logical operators, and String operators. For more information, be sure to see the Matrix, Array, and Variable Math and Flow Control pages.
The assignment and increment operators can be used with Variables, Arrays, and Matrices. The examples in the table below use the following objects:
The following assignment and increment operators are available in FreeFlyer:
Note: The reference assignment operator can be used to create a reference from one object to another. For example, you can configure an element of a List<Spacecraft> to refer to a separate Spacecraft object that you created in the object browser. You can also configure an element of a Struct to refer to an object that you created separately. The Object.ReferenceEquals() method can be used to check whether one object refers to another.
The examples in the table below use the following objects:
The following mathematical operators are available in FreeFlyer:
The literal operators described below can be used to conveniently create literal Array or Matrix objects in FreeFlyer script. See the Matrix, Array, and Variable Math page for more information. The examples in the table below use the following objects:
FreeFlyer supports the following literal operators:
The logical operators described below can be used in conjunction with the While and If statements. Nested Flow Control loops can be used to test and handle complex decisions. It is possible to test for multiple logical conditions in a single Flow Control statement by using the logical operators “and” or "or”. The examples in the table below use the following objects.
FreeFlyer supports the following logical operators.
Compound Boolean Statements
Previous to FreeFlyer 6.5, Boolean expressions evaluated left to right. In the script above, this leads to a grouping like:
(v == 0 or v == 0) and v == 1
In FreeFlyer 6.5 and higher, the and operator takes precedence over the or operator leading to a grouping like:
v == 0 or (v == 0 and v == 1)
In the example given, the expression evaluates to true in FreeFlyer 6.5, but false in previous versions. In FreeFlyer 6.5 and higher, you can also use parentheses to group expressions and explicitly specify the order of evaluation you desire.
There are a number of String-specific operators that are unique in how they are evaluated. None of the boolean-returning operators below can be used in-line in conditional statements as they all return an Array of boolean values. The examples in the table use the following objects.
FreeFlyer supports the following String operators.