Search HouseOfScripts.com

 

All Scripts        JavaScripts        ASP Scripts        Other Scripts

 

  Operators Page asp, send, email, cdonts, link, recordset, hyper, hyperlink, create, list, box, dependant, dynamic

There are few different Operators:

Arithmetic

Assignment

Comparison

Logical

String


Arithmetic Operators

Operator
Description
Example
Result
+
Addition
x=3
x+2
5
-
Subtraction
x=4
5-x
1
*
Multiplication
x=6
x*5
30
/
Division
35/5
11/2
7
5.5
%
Modulus (division remainder)
5%2
10%8
10%2
1
2
0
++
Increment
x=3
x++
x=4
--
Decrement
x=3
x--
x=2

Assignment Operators

Operator
Example
Same As
=
x=y
x=y
+=
x+=y
x=x+y
-=
x-=y
x=x-y
*=
x*=y
x=x*y
/=
x/=y
x=x/y
%=
x%=y
x=x%y

Comparison Operators

Operator
Description
Example
==
is equal to
3==7 returns false
!=
is not equal
3!=7 returns true
>
is greater than
3>7 returns false
<
is less than
3<7 returns true
>=
is greater than or equal to
3>=7 returns false
<=
is less than or equal to
3<=7 returns true

Logical Operators

Operator
Description
Example
&&
and
x=4
y=8
(x < 10 && y > 1) returns true
||
or
x=4
y=8
(x==5 || y==5) returns false
!=
not
x=4
y=8
x != y returns true

String Operators

If we want to combine two ore more strings, we use + operator:
msg1="House"
msg2="Of Scripts!"
msg3=msg1+mdg2
Now msg3 = HouseOf Scripts! (Note: There is no space between House and Of...)

 

There are two ways to insert space into the expression:
msg1="House "
msg2="Of Scripts!"
msg3=msg1+mdg2
Now msg3 = House Of Scripts! (Note: I insert space after House in msg1)
OR
msg1="House"
msg2="Of Scripts!"
msg3=msg1 + " " + mdg2
Now msg3 = House Of Scripts! (Note: I think it is clear)

 

 


Home       Scripts       Active WebTools       Web Templates       Forum       Tools        Hosting       Questions/Comments       Add/Request