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:

  • Difference between procedures and functions in vb script Difference between procedures and functions in vb script Major difference between procedures and functions in vb script is that procedures can not return the value but functions can return the value.Procedure Example… Read More
  • Loops in Vbscript Loops in Vbscript Here is the list of different looping statements in vbscript. For ....Next For Each ...Next Do While...Loop Do Until....Loop While...Wend 'You can exit from For Loop with Exit For statement'For Loo… Read More
  • String functions in vbscript String functions in vbscript Below is the list of string functions in vb script lcase ucase len left right mid ltrim rtrim trim replace strreverse string Instr Instrrev strcomp We are going to have a look at each St… Read More
  • Sub Procedures in VBScript Sub Procedures in VBScript Sub procedures are used to perform the specific task. Sub procedures are used to increase the reusability of the code. Simple example of the procedure Suppose you want to find the sum of … Read More
  • What are different conditional statements in vbscript? What are different conditional statements in vbscript? In Vbscript there are 2 types of conditional statements. if ...else Select Case Example of if else -  a = 10 If a > 10 Then Msgbox "a is greater t… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,700

Blog Archive