Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

Select Case

The Select Case statement allows you to evaluate an expression and perform multiple actions based on the result of that expression.

The Select Case statement starts a block of code that ends with the End Case statement. Within this block, you put as many Case statements as you like. Each Case statement contains a literal value or list of literal values (separated by commas) to match.

When the Select Case code is evaluated, the first matching case is found that matches the expression. That code is executed and then the Select Case block is exited.

' display a greeting based on the hour Select Case Hour(Now())
    Case 0, 1, 2, 3, 4, 5
        Response.Write "Good Night!"
    Case 6, 7, 8, 9, 10, 11
        Response.Write "Good Morning!"
    Case 12, 13, 14, 15, 16, 17
        Response.Write "Good Afternoon!"
    Case 18, 19, 20, 21, 22, 23
        Response.Write "Good Evening!"
End Select

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"Success is how high you bounce when you hit bottom." - General George Patton

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.