<% @ Language = JScript %> identifies your aspCodeScript Language
In ASP, you can write VB or JS as you like.
Script Language: Both JavaScript and VBScript are scripting languages. If the identifier is <% @ Language = %>
The default scripting language for IIS.
Dim Public Private is used for variable declaration.
<% Dim I, K %> if it is not declared, it is implicitly declared by default.
Operator-Arithmetic Operator
-*/\ (Entire division) mod +-& (string connection)
Operator-comparison operator
= <> (Not equal) <> <=> =
Operator-comparison operator
Not and or (and or not)
If statement
<%
If a> 12 then
Response. Write "11111"
Else
Response. Write "2222"
End if
%>
For Loop
<%
For j = 1 to 10
Response. Write "me"
Next
%>
Now () Current Time
Constant definition: (const)
Number: const S = 6
String: const S = "GG"
Time: const #2009-01-12 #
Conditional statement (if... then... else select case)
<%
If a <5 then
Response. Write "111"
Elseif A <10 then
Response. Write "222"
Else
Response. Write "333"
End if
%>
<%
Dim
A = 10
Select case
Case 1, 2, 3, 4
Response. Write "1"
Case 5, 6, 7, 8
Response. Write "2"
Case 9,10
Response. Write "3"
%>
Loop statement
Do... loop condition is true Loop
The while... Wend condition is a true loop.
For... Next specifies the number of cycles
Foreach... next loop the array or set
First: equivalent to the while loop in C
<%
Do while
....
Loop
%>
The second type is equivalent to the do... while loop in C.
<%
Do
....
Loop while
%>
Example:
<%
Do while a <10
Response. Write "aaaa"
A = a + 1
Loop
%>
<%
For I = 1 to 10 Step 2 // Step 2
Response. Write "DDD <br>"
Next
%>
Process (function)
The difference between sub and function is that sub has no return value, while function has a return value.
Definition:
Sub ()
Msgbox "Haha"
End sub
Call call ()
Sub mm (A, B)
Msgbox (A & B)
End sub
Call a ("DD", "cc ")
<%
Function ()
....
End Function
%>