ASP Getting Started Tutorial: ASP operators

Source: Internet
Author: User

ASP is a programming preset in VBScript, so the ASP technology operators are running VBScript defaults, so the operator inside the ASP and VB is the same,

The ASP operators are divided into four classes of mathematics, compared to some more advanced logical operators and leftovers (those unsuitable for any category).

ASP operators
Mathematics is similar in many other programming languages to ASP operators. However, ASP technology does not support fast operators such as + +,-, + =, etc.

Result
Operator 中文版 Example
+ Addition MyNum = 3 + 4 MyNum = 7
- Subtraction MyNum = 4-1 MyNum = 3
* Multiplication MyNum = 3 * 2 MyNum = 6
/ Division MyNum = 9/3 MyNum = 3
^ Exponential MyNum = 2 ^ 4 MyNum = 16
Mod Modulus MyNum = Mod 10 MyNum = 3
- Negation MyNum =-10 MyNum =-10
Integer Division MyNum = 9 3 MyNum = 3

Comparison operators
compare two values to make a decision when the operator is in use. Comparison operator most commonly used with "if ... Then the "and" thing though is really done this point ... "Declaration, otherwise known as a conditional statement. The project is often compared with the number. As a result of comparison, the operator is true or false.

Result
Operator 中文版 Example
= Equal to 4 = 3 False
< Less Than 4 < 3 False
> Greater Than 4 > 3 True
<= Less Than Or Equal to 4 <= 3 False
>= Greater Than Or Equal to 4 >= 3 True
<> Not Equal to 4 <>3 True

logical operators
The comparison operator above results in true or false value of truth. A logical operator is used for complex statements that must be made based on the value of one or more of these truths.

Result
Operator 中文版 Example
and Both must be TRUE True and False False
Or One must be TRUE True or False True
Not Flips Truth Value Not True False

string operator
The only string operation is the string concatenation operator "," These two strings, and lashed them together to form a new string. One example is the string = "Tim" and the string = "is a Hero". The following code merges the two strings together into one: String3 = string and string

Opera Tor 中文版 Example result
& String concatenation String4 = "Bob" & "runs" String4 = "Bob runs"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.