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 Windows Script Host? What is Windows Script Host? WSH is a scripting host for Windows Script compatible scripting engines.WSH supports various scripting languages like vbscript, javascript, python etc.You can do below operations using WSH… Read More
  • File system object in vb script File system object in vb script Filesystemobject can be used to work with drives, folders, and files.Filesystemobject  has methods and properties that allow us to create, delete, gain information about, and gener… Read More
  • Error handling in VBScript Error handling in VBScript VBScript provides below statements and keywords to handle errors. on error resume next Err object - err.description, err.number Sample code to handle the error is given below If er… Read More
  • Regular Expressions in vb script example Regular Expressions in vb script example Regular expressions BasicsDefinition :A regular expression is a pattern of characters(meta characters and special characters). General Applications of Regular Expression… Read More
  • Dictionary Object in vb script Example Dictionary Object in vb script Example Dictionary object is used to store the data in key-item pairs in qtp.A Dictionary object is just like an associative array.It stores the data in the form of key-item pairs.Each k… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,857

Blog Archive