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.