Http://www.tizag.com/aspTutorial/aspOperators.php
ASP Arithmetic Operators
The mathematical operators in ASP are similar to your other programming languages. However, ASP does not support using cut operators like ++, --, ++ =, etc.
operator |
English |
example |
result |
+ |
addition |
mynum = 3 + 4 |
mynum = 7 |
- |
subtraction |
mynum = 4-1 |
mynum = 3 |
* |
multiplication |
mynum = 3*2 |
mynum = 6 |
/ |
Division |
mynum= 9/3 |
mynum = 3 |
^ |
exponential |
mynum = 2 ^ 4 |
mynum = 16 |
mod |
modulus |
mynum = 23 mod 10 |
mynum = 3 |
- |
negation |
mynum =-10 |
mynum =-10 |
\ |
Integer Division |
mynum = 9 \ 3 |
mynum = 3 |
Comparison Operators
Comparison operators are used when you want to compare two values to make a demo. comparison operators are most commonly used in conjunction with "if... then "and" while something is true do this... "statements, otherwise known as conditional statements. the items that are most often compared are numbers. the result of a comparison operator is either true or false.
Operator |
English |
Example |
Result |
= |
Equal |
4 = 3 |
False |
< |
Less |
4 <3 |
False |
> |
Greater |
4> 3 |
True |
<= |
Less than or equal |
4 <= 3 |
False |
> = |
Greater than or equal |
4> = 3 |
True |
<> |
Not equal |
4 <> 3 |
True |
Logical operators
The above comparison operators result in a truth value of true or false. A logical operator is used for complex statements that must make decisions based on one or more of these trese values.
Operator |
English |
Example |
Result |
And |
Both must be true |
True and false |
False |
Or |
One must be true |
True or false |
True |
Not |
Flips truth value |
Not true |
False |
String Operators
The only string operator is the String concatenation operator "&" that takes two strings and slams them together to form a new string. an example wocould be string1 = "Tim" and string2 = "is a hero ". the following code wocould combine these two strings into one: string3 = string1 & string2
Operator |
English |
Example |
Result |
& |
String concatenation |
String4 = "Bob" & "runs" |
String4 = "Bob runs" |
We will be using these operators throughout the tutorial, so chances are you will get understand them more and more as this tutorial goes on.