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