Getting Started with ASP beginners: basic syntax

Source: Internet
Author: User
Tags arithmetic operators constant integer integer division logical operators variables variable valid
Beginners | grammar

set up an ASP program

An ASP program is a text file with an. asp extension, including text, HTML statements, ASP commands, and other scripting languages.
ASP commands must be placed between "<%" and "%>"

Program Annotation

In order to develop a good programming style, a modest annotation is necessary, the ASP provides two ways to annotate

1, but the quotation mark (), after the single quotation mark this line of text is considered as a comment
2, REM keywords, in rem after the text, as a comment

Assignment statement

The assignment statement of general variables in ASP is "="
And the object is assigned with the SET statement.

Arithmetic operators

Operator Function
+ Plus
- Minus sign
+ Addition
- Subtraction
* Multiplication
/ Division
\ Integer division
Mod Remainder
^ Index

Relational operators

Operator Function
= Equals
<> Not equal to
The Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Is Compare whether a variable points to the same object

logical Operators

The logical operators for ASP are:

1, not to reverse the logical value
2, and "and" or "and" operations.
3, or "or" operation
4, XOR "exclusive or" operation
5, EPV judge two expression logic equal, the same result is true, otherwise false
6. IMP determines whether two expressions are logically related

string Operators

The ASP has only one string operator, which can force two of expressions to do string concatenation

Variable Declaration

Variable declaration must be noted

1. A valid variable name cannot be greater than 255 characters
2. The variable name must begin with a letter
3. The variable name must be unique within the same valid range

Variable declaration DIM variable name
Constant declaration CONST Constant name = constant value

Data Type

For the ASP, it has only one variant (universal variable) data type, which is a very special type of data, and you can assign any data type to such variables as Boolean, Byte, Integer, Long Integer, single-precision floating-point number, double-precision floating-point number, currency, date, and so on.



Related Article

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.