Learn about Basic ASP Variables (7 ASP):
As we all know that variable is used to store information. There are different types of variables in ASP.
Something about Variable’s Lifetime:
Those variables which are declared outside the procedure can be easily changed or accessed by using any script in ASP. But those variables which are declared inside the procedure cannot be changed or accessed by any scripts. Because they are created and destroyed every time a procedure is executed. The main two types of Variables are:
Those variables which store information of only single user but they are available on all the pages in a single application are known as Session Variables. Mostly the type of information stored in these variables is: name, id and preferences.
These variables are also available to all the pages in the application. But they are used to store information of many, in fact, all the users in one particular application.
How to declare a text value variable:
Following is an easy example to show how to store a text as a value in the variable:
response.write(“My name is” & name)
My name is Tweety
How to declare a array:
Following is an easy example to show how to store a text as a array:
Framename(0) = “tweety”
Framename(1) = “sweeto”
Framename(2) = “dan brown”
Framename(4) = “angel”
Framename(5) = “ben ten”
Framename(6) = “lara croft”
For m = 0 to 6
response.write(framename(m) & <br/>)