Functional Composition
Functional composition is basic sequence control for expressions.
Functional composition is basic sequence control for expressions. The hierarchy of operations is followed. Multiplication comes first, then division, then addition, and then finally subtraction. The operations can be altered by means of parentheses. The operations in the innermost parentheses are executed first, and then the next set, and then the outermost set is performed last.
A quick heads up for operations in programs is "MDAS," Multiplication, Division, Addition, and then Subtraction. You can try tinkering with the MDAS rule with your Visual Basic Editor. See how the values in the Message Box will change.
Short Circuit Evaluation
There are some cases where all the expressions are not evaluated. This is called short circuit evaluation. In Boolean expressions that use “and” or “or,” the second operand may have an error, thus making it negligible and not evaluated. In an “and” statement, if the first operand is already false then the program may not even have to evaluate the second operand. In an “or” statement, if the first operand is already true then the program may not even have to evaluate the second operand and may directly proceed to the subsequent action.
Assignment Statements
Assignment statements are used to change the binding of values to a variable. It also causes a value to be copied from one memory location to another. In Visual Basic, assignment can be done using the “= ” sign. Assignment operation is from right to left. For instance, in the statement, “A= B = C,” the value of C is assigned to B and then the value of B is finally assigned to A.