Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Operators
Eqv Operator
Is Operator
OPERATOR: =
Implemented in version 1.0
=
The
operator is used to assign a value to a variable, or to compare strings and numbers, or to print out the value of a variable.
When used for assignment, a single variable on the left side of the
=
operator is given the value determined by one or more variables and/or expressions on the right side.
Code:
<% mynumber = 5.0 + 7.9*(444.999 / 456.9) %>
<% mystring = "The moon is 2160 miles in diameter." %>
<% myvar = xxx + yyy + zzz %>
<% myarray(40) = 12345 %>
The
=
operator can also compare two strings or two numbers and see if they are the same. For strings, the comparison is case sensitive.
Code:
<% ="Apple"="Apple" %>
<% ="aPPle"="ApplE" %>
<% =123=123 %>
<% =5.67=98.7 %>
Output:
True
False
True
False
When the
=
operator is used to print out the value of a variable, the statement must be enclosed by its own set of <% %>. There can blank spaces between the
=
operator and the variable.
Code:
<% myfish = "Neon tetra" %>
<% =myfish %>
<% = myfish %>
Output:
Neon tetra
Neon tetra
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information