
Asp Vb Keywords in ASP
Sure! Here’s a handy list of common VBScript keywords you’ll encounter and use in Classic ASP:
Common VBScript Keywords in ASP
Keyword | Description |
---|---|
Dim | Declare variables |
Const | Declare constants |
Set | Assign object references |
If...Then...Else | Conditional statements |
ElseIf | Additional conditional branch |
End If | Ends an If block |
For...Next | Loop with counter |
Do...Loop | Loop with condition |
While...Wend | Loop while condition |
Function | Declare a function (returns value) |
End Function | Ends a function |
Sub | Declare a subroutine (no return) |
End Sub | Ends a subroutine |
Call | Call a Subroutine or Function |
Select Case | Multi-way branch (switch case) |
Case | Branch in Select Case |
Exit For | Exit a For loop early |
Exit Do | Exit a Do loop early |
True | Boolean true |
False | Boolean false |
Not | Logical NOT operator |
And | Logical AND operator |
Or | Logical OR operator |
Mod | Modulus operator (remainder) |
Is | Object comparison |
Nothing | Represents no object |
On Error Resume Next | Error handling (ignore errors) |
Option Explicit | Forces variable declaration |
Example: Using some keywords in ASP
<%Option ExplicitDim iFor i = 1 To 5 If i Mod 2 = 0 Then Response.Write i & " is even<br>" Else Response.Write i & " is odd<br>" End IfNext%>
If you want me to explain specific keywords, show more examples, or cover ASP-specific objects like Request
, Response
, Session
, just say!