⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vbs230.htm

📁 VBScript 是一种脚本语言
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Operator Precedence</TITLE> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="CATEGORY" CONTENT="Language Reference">

<META NAME="Keywords" CONTENT="math operators,logical operators,operator precedence,order of precedence,arithmetic operators,comparison operators,precedence operator,hierarchy of operations,precedence"><META NAME="Description" CONTENT="Operator Precedence"></HEAD><BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft&#174; Visual Basic&#174; Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>Operator Precedence</B></FONT>

</TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2>&nbsp;<A HREF="vbstoc.htm">Language&nbsp;Reference</A>&nbsp;<BR>
<A HREF="vbs16.htm">Version&nbsp;1</A>&nbsp;<P></FONT>

</TD></TR>
</TABLE> 

<FONT SIZE=2><p>
<A HREF="vbs231.htm">See Also</A></FONT>
<HR noshade SIZE=1>

<H5>Description</H5>
<BLOCKQUOTE>When several operations occur in an expression, each part is evaluated and resolved in a predetermined order called operator precedence. Parentheses can be used to override the order of precedence and force some parts of an expression to be evaluated before other parts. Operations within parentheses are always performed before those outside. Within parentheses, however, normal operator precedence is maintained.<P>
When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last. Comparison operators all have equal precedence; that is, they are evaluated in the left-to-right order in which they appear. Arithmetic and logical operators are evaluated in the following order of precedence:<P>

<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Arithmetic</b></FONT></TD>
<TD><FONT SIZE=2><b>Comparison</b></FONT></TD>
<TD><FONT SIZE=2><b>Logical</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Exponentiation (<b>^</b>)</FONT></TD>
<TD><FONT SIZE=2>Equality (<b>=</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Not</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Negation (<b>-</b>)</FONT></TD>
<TD><FONT SIZE=2>Inequality (<b>&lt;&gt;</b>)</FONT></TD>
<TD><FONT SIZE=2><b>And</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Multiplication and division (<b>*</b>, <b>/</b>)</FONT></TD>
<TD><FONT SIZE=2>Less than (<b>&lt;</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Or</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Integer division (<b>\</b>)</FONT></TD>
<TD><FONT SIZE=2>Greater than (<b>&gt;</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Xor</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Modulus arithmetic (<b>Mod</b>)</FONT></TD>
<TD><FONT SIZE=2>Less than or equal to (<b>&lt;=</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Eqv</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Addition and subtraction (<b>+</b>, <b>-</b>)</FONT></TD>
<TD><FONT SIZE=2>Greater than or equal to (<b>&gt;=</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Imp</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>String concatenation (<b>&</b>)</FONT></TD>
<TD><FONT SIZE=2><b>Is</b></FONT></TD>
<TD><FONT SIZE=2><B>&amp;</B></FONT></TD></TR>
</TABLE><P>

When multiplication and division occur together in an expression, each operation is evaluated as it occurs from left to right. Likewise, when addition and subtraction occur together in an expression, each operation is evaluated in order of appearance from left to right.<P>
The string concatenation operator (<b>&amp;</b>) is not an arithmetic operator, but in precedence it does fall after all arithmetic operators and before all comparison operators. The <b>Is</b> operator is an object reference comparison operator. It does not compare objects or their values; it checks only to determine if two object references refer to the same object.</BLOCKQUOTE>

<hr noshade size=1>
<p align=center><em><a href="../../common/colegal.htm">&copy; 1997 by Microsoft Corporation. All rights reserved.</a></em></p> 
</FONT></BODY></HTML>














































































⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -