Use the scriptiing dictionary object which is available on later versions of ASP Classic (all still commonly in use). Both Access VBA and VB Classic use a collection for this but collections are not supported in ASP Classic.
Dim StateList
Set StateList = Server.CreateObject("Scripting.Dictionary") StateList.Add "CA", "California"
StateList.Add "NV", "Nevada"
Response.Write "I live in " & StateList.Item("CA")
In ASP Classic, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.
When an object instance is created from a class, ASP calls a special parameter-less sub named Class_Initialize. Since you cannot specify parameters for this sub, you also cannot overload it.
When a class is destroyed, ASP calls a special sub called Class_Terminate.
Commenting Code ASP Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). ASP Classic does NOT have a multiple line comment.
Preprocessor Directives - @ and # An @ is used for preprocessor directives within ASP code (within <% %>) and a # is used for HTML-style preprocessor directives.
Note: ASP Classic does not support VB Classic's #If directive.
Commenting Code ASP Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). ASP Classic does NOT have a multiple line comment.
Preprocessor Directives - @ and # An @ is used for preprocessor directives within ASP code (within <% %>) and a # is used for HTML-style preprocessor directives.
Note: ASP Classic does not support VB Classic's #If directive.
With ASP Classic, you simply copy your files to a web server that is capable of running ASP pages. This includes your .ASP pages along with supporting files such as images, include files, and database files.
Optionally, you can also deploy a global.asa file which is used to code certain events like application start, application end, session start, and session end.
6. Using Request.QueryString
Although you can use the generic request collection, as in Request("SomeValue"), for either Request.Form("SomeValue") or Request.QueryString("SomeValue"), it's best to avoid the generic request collection until it's really needed. Use a For Each loop to loop through elements.
The following function demonstrates one technique for coding a Yes/No dropdown. It uses a for loop which can be expanded to handle more than the 3 states (Y, N, and blank).
When an object instance is created from a class, ASP calls a special parameter-less sub named Class_Initialize. Since you cannot specify parameters for this sub, you also cannot overload it.
When a class is destroyed, ASP calls a special sub called Class_Terminate.