ASP Getting Started Tutorial: ASP variable [Variables]

Source: Internet
Author: User

A variable is used to store information.

If the variable is a declaration program, you can change the script by any ASP file. If the variable is an internally announced program, it is created and destroyed each time the program executes.

Example

<body>

<%
Dim name
Name= "Donald Duck"
Response.Write ("My Name is:" & name)
%>

</body>
My name Is:donald Duck

Declaring an array
Arrays are used to store a series of related data items. This example demonstrates how to declare the name of an array store.

<body>

<%
Dim Famname (5), I
Famname (0) = "Egil"
Famname (1) = "Tove"
Famname (2) = "Hege"
Famname (3) = "stale"
Famname (4) = "Kai Jim"
Famname (5) = "Borge"

For i = 0 to 5
Response.Write (Famname (i) & "<br/>")
Next
%>

</body>
Output results.

Egil
Tove
Hege
Stale
Kai, Jim.
Borge

HTML headers through the ring
How to loop through the six headers of HTML.

<body>

<%
Dim i
For I=1 to 6
Response.Write ("Next
%>

</body>

Header 1

Header 2

Header 3

Header 4

Header 5

Header 6

Life variable
An ASP file in any script can be changed outside of the program declared by a variable.

A variable declaration program is created and destroyed in each program execution. Programs other than scripts can access or change variables.

Declaring variables can be more than one ASP file, declaring them as session variables or applicable variables.

Session variables
Session variables are used to store information for a single user and are provided to all Web pages in one application. Usually the information stored in the session variable is the name, number, and preferences.

Applying variables
Variable applications are also provided to all Web pages in one application. Application variables are used to store information for all users in a particular application.

Reprint please indicate from www.111cn.net/asp/asp.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.