We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
If this tool helped you, you can buy us a coffee ☕
Quickly check Visual Basic operator precedence and associativity. Resolve VB expression calculation issues with this free online reference guide.
^ArithmeticRight-associative计算左操作数的右操作数次幂,是 VB 算术运算中优先级最高的一类。
2 ^ 3+aArithmeticRight-associative保留数值本身,通常用于强调操作数为正值或数值表达式。
+score-aArithmeticRight-associative返回操作数的相反数,优先级高于乘除但低于乘方。
-amount*ArithmeticLeft-associative两个数值相乘。
price * count/ArithmeticLeft-associative执行除法并返回浮点结果。
total / count\ArithmeticLeft-associative执行整数除法,结果保留整数部分。
total \ 3ModArithmeticLeft-associative返回整数除法后的余数。
index Mod 2+ArithmeticLeft-associative将两个数值相加;在部分上下文中也可能参与字符串拼接。
a + b-ArithmeticLeft-associative从左操作数中减去右操作数。
endValue - startValue&String ConcatenationLeft-associative将两个表达式转换并连接为字符串,建议优先用它表达字符串拼接。
"VB" & "Script"=ComparisonNon-associative判断两个表达式是否相等。
status = "OK"<>ComparisonNon-associative判断两个表达式是否不相等。
status <> "OK"<ComparisonNon-associative判断左操作数是否小于右操作数。
age < 18>ComparisonNon-associative判断左操作数是否大于右操作数。
score > 90<=ComparisonNon-associative判断左操作数是否小于或等于右操作数。
count <= maxCount>=ComparisonNon-associative判断左操作数是否大于或等于右操作数。
count >= minCountLikeComparisonNon-associative按 VB 的通配符模式比较字符串。
fileName Like "*.txt"IsComparisonNon-associative判断两个对象引用是否指向同一对象,常与 Nothing 搭配。
obj Is NothingNotLogicalRight-associative对布尔表达式取反,也可对整数执行按位取反。
Not isReadyAndLogicalLeft-associative两个条件都为 True 时结果为 True,也可执行按位与。
isReady And hasAccessOrLogicalLeft-associative任一条件为 True 时结果为 True,也可执行按位或。
isAdmin Or isOwnerXorLogicalLeft-associative两个布尔值不同时返回 True,相同时返回 False。
flagA Xor flagBEqvLogicalLeft-associative两个布尔值相同时返回 True,不同时返回 False。
flagA Eqv flagBImpLogicalLeft-associative表示逻辑蕴含关系,仅当左侧为 True 且右侧为 False 时结果为 False。
flagA Imp flagBWhen writing Visual Basic expressions, operator precedence directly determines the order of evaluation. Confusion can easily lead to incorrect results. The VB Operator Precedence Checker displays the precedence and associativity of all operators in a clear, hierarchical table. It helps developers quickly verify the order of arithmetic, comparison, concatenation, and logical operators, avoiding logical bugs in code.
3 + 4 * 2 ^ 2, checking the table shows that the exponentiation operator ^ has the highest precedence, followed by multiplication *, and finally addition +. The result is 3 + 4 * 4 = 19, not 7 * 4 = 28.True Or False And False will first evaluate False And False (which is False), and then evaluate True Or False (which is True).The precedence displayed in this tool is based on VB6/VBA specifications. VB.NET introduces new operators and adjusts some precedence levels, so please verify your language version when using this tool. All operator precedence follows strict evaluation rules; relying solely on memory is not recommended. For complex expressions, please use parentheses to explicitly define the order. This page is a read-only reference, does not involve user privacy data, and is completely safe to use.
Comparison operators (=, <>, <, >, <=, >=, Is, Like) share the same precedence level and associate from left to right. String concatenation operators (& and +) also share the same precedence. When multiple operators of the same precedence appear in an expression, they are evaluated sequentially from left to right. If you cannot immediately determine the precedence, the safest practice is to enclose core sub-expressions in parentheses. This not only improves readability but also guarantees the correct order of evaluation.

JSON Formatter
Process JSON data online: format, minify, and validate to boost your development and debugging efficiency.

URL to JSON Parser
Parse URL strings into structured JSON to quickly extract key information like protocols, parameters, and paths.
VBScript Code Formatter
Free online VBScript code formatter and beautifier. Automatically standardize indentation and line breaks for your VBS scripts.

PYC Decompiler
Restore Python bytecode .pyc files into readable source code for easy code auditing and learning. Supports mainstream versions.

JSON Formatter
Process JSON data online: format, minify, and validate to boost your development and debugging efficiency.

URL to JSON Parser
Parse URL strings into structured JSON to quickly extract key information like protocols, parameters, and paths.
VBScript Code Formatter
Free online VBScript code formatter and beautifier. Automatically standardize indentation and line breaks for your VBS scripts.

PYC Decompiler
Restore Python bytecode .pyc files into readable source code for easy code auditing and learning. Supports mainstream versions.

Code Compare
Professionally compare differences between two texts or code snippets. Highlights additions, deletions, and modifications to assist with code review, document merging, and version control.