%@ LANGUAGE = JScript %>
Variable Sample
Variable Sample
Integer Manipulation
<%
//Declare variable.
var intVar;
//Assign the variable an integer value.
intVar = 5;
%>
<%= intVar %> + <%= intVar %> =
<%= intVar + intVar %>
String Manipulation
<%
//Declare variable.
var strVar;
//Assign the variable a string value.
strVar = "Jemearl";
%>
This example was done by <%= strVar + " Smith" %>
Boolean Manipulation
<%
//Declare variable.
var blnVar;
//Assign the variable a boolean value.
blnVar = true;
//Output Message based on value.
if (blnVar)
{
Response.Write("The boolean value is True.
");
}
else
{
Response.Write("The boolean value is False.
");
}
%>
Date and Time
<%
//Declare variable.
var dtmVar;
//Assign the variable a value.
dtmVar = new Date(1997, 8, 27, 17, 11, 42);
%>
The date and time is <%= dtmVar %>
<%
//Set the variable to the web server date and time.
dtmVar = new Date();
%>
The system date and time
is <%= dtmVar %>