Thursday, January 3, 2019



What are the different operators in vbscript?

At broad level there are 3 kinds of operators as mentioned below.

  1. Arithmetic Operators
  2. Comparison Operators
  3. Logical Operators


Arithmetic Operators in the order of precedence and their usage.
Exponentiation ^
Unary negation -
Multiplication *
Floating point Division /
Integer division \
Modulus arithmetic Mod  -gets the remainder
Addition +
Subtraction -
String concatenation & - concatenates 2 strings

Comparison Operators and their usage.
Equality =
Inequality <>
Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Object equivalence Is

Logical Operators in the order of precedence and their usage.
Logical negation Not
Logical conjunction And
Logical disjunction Or
Logical exclusion Xor
Logical equivalence Eqv
Logical implication Imp


Example - 

if a>10 and b<99 then 
    msgbox "a is greater than 10 and b is less than 99"
end if

msgbox "Remainder after dividing 10 by 3 is -> " & (10 mod 3)


Related Posts:

  • What is vbscript? What is vbscript? VBScript Intoduction Vb script is a scripting language used for performing administrative tasks in system programming.Vb script is a loosely typed language meaning we don't need to define the type of… Read More
  • Basic Syntax in VBScript Basic Syntax in VBScript Basic VBScript SyntaxRemember below points about VBScript Syntax. VBScript is loosely typed language that means you do not need to declare the variables with data type VBScript comments start … Read More
  • What are the different operators in vbscript? What are the different operators in vbscript? At broad level there are 3 kinds of operators as mentioned below. Arithmetic Operators Comparison Operators Logical Operators Arithmetic Operators in the order of pre… Read More
  • Data Types in vbscript Data Types in vbscript In vb script all variables are initialized with the data type called variant. But we can have below sub-types in vb script. In below table we have mentioned all sub data types in vb sc… Read More
  • Types of variables in Vbscript Types of variables in Vbscript Variables are storage locations in memory where we can store the the values.In vb script there are 3 types of variables. Scalar  - contains only one value. Array - contains many val… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

150,593

Blog Archive