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

 

 

 

 

 

 

 

 

 

 

 

 

Dim

The Dim statement is used to declare a variable for use. You can declare each variable with a separate Dim statement or declare multiple variables by separating the variable names with commas (,).

You should note that constants are not declared with the Dim statement. They are declared and assigned their value with the Const statement.

Dim    sVar        ' single var -- you can add comments here Dim sVar1, sVar2, sVar3        ' this is more difficult to comment Dim I, J, K                    ' but is useful for generic counters


You should make sure to declare all of your variables in Active Server Pages because of the way that ASP manages variable storage. Your performance will suffer if you fail to declare your variables.

If you want to make sure that all of your variables have been declared, you can check by inserting the statement Option Explicit at the beginning of your script. This will cause the script to throw a runtime error when a variable is used without being declared (using the Dim statement) first.

Orvado Technologies

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

Contact Us | Contribute | About | Site Map



"All programmers are playwrights and all computers are lousy actors." - Anon

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