Flowgorithm expressions allow the operators used in two major families of
programming languages. The "BASIC-family" contains English keywords and
operators. The "C-family"
(which includes C, Java, C#) is far more symbolic.
Since both families are supported, there are redundant
operators. Either the "C Family" or "Basic Family" can be used.
This allows the student to use the operators that match the language they
plan to to learn later.
Flowgorithm also adds a few unique Visual Basic operators since if they have helpful,
clearly defined, semantics
|Visual Basic Operator
In Java and C#, the + operator is used for both string concatenation
and addition. This can be quite confusing given the rather complex
semantics. In Flowgorithm, addition will only work with numbers. The ampersand
& is used for concatenation.
Also, C# and Java lack an exponent operator - instead relying their
respective Math classes. Flowgorithm uses the Visual Basic
The following are the precedence levels from high (evaluated first) to
||- ! not
||In Visual Basic, "not" precedence level is far
lower - above "and", but below all relational operators.
||The exponent operator does not exist in C#
||Division will always be high-precision
||In Flowgorithm, "+" will only work with numbers.
||C# and Java use the ambiguous "+" operator for
addition and concatenation.
||> >= < <=
== = != <>
|1 + 3 ^ 2
10 * 2 + 5 * 6
||10 * 2 and 5 * 6 have higher precedence
than addition. The addition is done last.
7 * (4 - 1)
||Parenthesis are used for subexpressions,
which are evaluated as a whole.
|6 / 3 * 2
||In mathematics, multiplication and
division have the same precedence levels. So, they are evaluated
left-to-right. The "PEMDAS" acronym, used in high-school, is a tad
|10 mod 3
||Modulo math gives the remainder from
|10 % 3
||Same expression, but using the C-Family