VBScript Tutorials - Herong's Tutorial Examples - v6.02, by Herong Yang
Precedences of Operations
This section provides the order of precedence for operations commonly used in VBScript. Operations in a complex expression must be evaluated according to the order of operation precedence.
In the previous section, we learned that operations in a complex expression must be evaluated according to the order of operation precedence. The following table shows you the relative order of precedence for some commonly used operations:
Precedence Operations Notes 12 (...) Operation group 11 ^ Exponentiation 10 - Unary negation 9 * / \ Mod Multiplication, Division, ... 8 + - Addition and Subtraction 7 & + String concatenation 6 = <> < > <= >= Comparisons 5 Not Logical negation 4 And Logical conjunction 3 Or Logical disjunction 2 Xor Logical exclusion 1 Eqv Logical equivalence 0 Imp Logical implication
Remember that:
See the next section for examples of expressions and evaluation orders.
Table of Contents
Introduction of VBScript - Visual Basic Scripting Edition
Variant Data Type, Subtypes, and Literals
Numeric Comparison Operations and Logical Operations
String Operations - Concatenation and Comparison
Variable Declaration and Assignment Statement
►Expression and Order of Operation Precedence
Statement Syntax and Statement Types
Array Data Type and Related Statements
Array References and Array Assignment Statements
Conditional Statements - "If ... Then" and "Select Case"
Loop Statements - "For", "While", and "Do"
"Function" and "Sub" Procedures
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
IE Web Browser Supporting VBScript