If you declare a variable outside of a subroutine, that variable can be changed by any script in the ASP file. If a variable is declared in the subroutine
Order, it is created and revoked every time the subroutine executes.
Instance: the
Declaration variable
variable is used to store information. This example shows how to declare a variable, assign a value to a variable, and use the variable
Declaration array
Array in a program to store a series of related data items. This example shows how to declare an array that stores a name. The
Loop generates an HTML caption
To loop through the generation of 6 different HTML headings.
Using Vbscript to make a time-based greeting
This example displays different messages to the user based on the server time.
Use JavaScript to make time-based greetings
In this case, it's just a different syntax. Variable lifetime
Variables declared outside the subroutine can be accessed and modified by any script in the ASP file. A variable declared in a subroutine by
is created and revoked only when the subroutine is executed every time. Scripts outside the subroutine cannot access and modify the variable
. Changchun Male Hospital
If you want to declare variables for use by multiple ASP files, declare the variables as session variables or application
variables. The
session Variable
Session variable is used to store information for a single user and is valid for all pages in an application. Typical data that stores
In a session is a name, ID, or parameter. The
application variable
Application variable is also valid for all pages in an application. The application variable is used to store information for all users in a specific application in