300+ Vb Script FAQs and Answers [Experienced / Freshers]

Vb Script Interview Questions with Answers

Question: 1. What Is Vbscript?

Answer:

Microsoft VBScript (Visual Basic Script) is a widespread-reason, light-weight and lively scripting language evolved by means of Microsoft this is modelled on Visual Basic. Nowadays, VBScript is the primary scripting language for Quick Test Professional (QTP), that is a take a look at automation tool.

Question: 2. What Are The Advantages Of Vbscript?

Answer:

Following are the benefits of VBScript:

VBScript is a lightweight scripting language, which has a lightning speedy interpreter.
VBScript, for the maximum part, is case insensitive. It has a totally easy syntax, clean to study and to implement.
Unlike C++ or Java, VBScript is an item-primarily based scripting language and NOT an Object-Oriented Programming language.
It makes use of Component Object Model (COM) in an effort to get entry to the factors of the surroundings wherein it’s far executing.
Successful execution of VBScript can show up best if it’s far achieved in Host Environment together with Internet Explorer (IE), Internet Information Services (IIS) and Windows Scripting Host (WSH).
VBScript Advanced Interview Questions
Question 3. What Are The Disadvantages Of Vbscript?

Answer:

Following are the hazards of VBScript:

VBscript is used best with the aid of IE Browsers. Other browsers including Chrome, Firefox DONOT Support VBScript. Hence, JavaScript is desired over VBScript.
VBScript has a Limited command line guide.
Since there may be no development environment to be had through default, debugging is difficult.
Question four. Is Vbscript Case Sensitive?

Answer:

No! VBScript is a case-insensitive language. This manner that language keywords, variables, function names and some other identifiers want NOT be typed with a regular capitalization of letters.

So identifiers int_counter, INT_Counter and INT_COUNTER have the equal which means within VBScript.

QTP Tutorial
Question five. What Are The Variable Naming Conventions In Vbscript?

Answer:

Variable is a named memory vicinity used to preserve a fee that can be modified in the course of the script execution. VBScript has handiest ONE essential statistics type, Variant.

Rules for Declaring Variables:

Variable Name should begin with an alphabet.
Variable names can’t exceed 255 characters.
Variables Should NOT include a period(.)
Variable Names ought to be precise within the declared context.
QTP Interview Questions
Question 6. How Do You Declare A Variable In Vbscript?

Answer:

Variables are declared the usage of “dim” keyword.

Question: 7. Do You Need To Specify The Type Of Variable During Declaration?

Answer:

No Since there may be simplest ONE essential statistics type, all the declared variables are version via default. Hence, a person NEED NOT mention the form of facts throughout declaration.

VB Script Tutorial Visual Basics Interview Questions
Question eight. How To Assign A Numeric Value To A Variable?

Answer:

The numeric values have to be assigned without double quotes.

Question: 9. How To Assign A String Value To A Variable?

Answer:

The String values should be enclosed within doublequotes(“).

Active Directory Interview Questions
Question 10. How To Assign A Date Value To A Variable?

Answer:

Date and Time variables need to be enclosed within hash symbol(#).

Software trying out Tutorial
Question eleven. What Are The Valid Scopes Of A Variable In Vbscript?

Answer:

Following are the scopes of variable in VBScript:

Dim
Public
Private
ActiveX Interview Questions
Question 12. What Is The Scope Of A Variable Declared Using Dim?

Answer:

Variables declared using “Dim” key-word at a Procedure stage are available best in the equal system. Variables declared using “Dim” Keyword at script degree are to be had to all of the approaches inside the identical script.

VBScript Advanced Interview Questions
Question thirteen. What Is The Scope Of A Variable Declared Using Public?

Answer:

Variables declared the use of “Public” Keyword are available to all the strategies throughout all of the associated scripts. When putting forward a variable of type “public”, Dim keyword is replaced through “Public”.

Script.Aculo.Us Tutorial
Question 14. What Is The Scope Of A Variable Declared Using Private?

Answer:

Variables that are declared as “Private” have scope handiest inside that script wherein they may be declared. When asserting a variable of kind “Private”, Dim keyword is changed by using “Private”.

Question: 15. How Will You Declare A Constant In Vbscript?

Answer:

Constants are declared the use of “const” keyword.

Software trying out Interview Questions
Question 16. What Is The Scope Of A Constant Declared Using Public?

Answer:

The Public constants are to be had for all of the scripts and procedures.

Software Development Lifecycle (SDLC) Tutorial
Question 17. What Is The Scopt Of Constant Declared Using Private?

Answer:

Private Constants are available within the process or Class.

Test Cases Interview Questions
Question 18. How Many Types Of Operators Vbscript Supports?

Answer:

VBScript language supports following forms of operators:

Arithmetic Operators
Comparison Operators
Logical (or Relational) Operators
Concatenation Operators
QTP Interview Questions
Question 19. Which Opearator Can Be Used To Get The Modulus Of Two Numbers In Vbscript?

Answer:

MOD opeator is used to get the modulus of two numbers.

Example:

Dim a : a = five
Dim b : b = 10
Dim c
c = b MOD a
Document.Write (“Modulus Result is ” &c)

Unittest Framework Tutorial
Question 20. Which Opearator Can Be Used To Get The Exponent Of A Number In Vbscript?

Answer:

^ opeator is used to get the exponent of two numbers.

Example:

Dim a : a = five
Dim b : b = 10
Dim c
c = b ^ a
Document.Write (“Exponentiation Result is ” &c)

Software Development Lifecycle (SDLC) Interview Questions
Question 21. Which Opearator Can Be Used To Check If Two Numbers Are Equal Or Not In Vbscript?

Answer:

<> operator is used to check if two numbers are same or no longer.

Example:

Dim a : a = 5
Dim b : b = 10
Dim c
c = b <> a
Document.Write (“Equality Check is ” &c)

Question: 22. Which Opearator Can Be Used To Do An Xor Operation In Vbscript?

Answer:

XOR Called Logical Exclusion operator. It is used to do an XOR operation.

Example:

A. Dim a : a = five
Dim b : b = 10
Dim c
c = b XOR a
Document.Write (“XOR Check is ” &c)

QUnit Testing Tutorial
Question 23. What Is The Output Of A + B In Vbscript If A = 5 And B = 10?

Answer:

+ operator provides  Values as Variable Values are Numeric. So A + B will provide 15.

Unittest Framework Interview Questions
Question 24. What Is The Output Of A + B In Vbscript If A = “vb” And B = “script”?

Answer:

+ operator concatenates  Values if values are string. So A + B will provide VBScript.

Visual Basics Interview Questions
Question 25. What Is The Output Of A & B In Vbscript If A = 5 And B = 10?

Answer:

& operator concatenates two values. So A + B will give 510.

TypeScript Tutorial
Question 26. What Is The Output Of A & B In Vbscript If A = “vb” And B = “script”?

Answer:

& operator concatenates  values. So A & B will supply VBScript.

QUnit Testing Interview Questions
Question 27. Can You Access Cookie Using Vbscript?

  [PDF] Pensioner’s Life Certificate And Jeevan Pramaan Certificate

Answer:

VBScript also can manage cookies using the cookie property of the Document item. JavaScript can study, create, modify, and delete the cookie or cookies that practice to the contemporary web web page.

Active Directory Interview Questions
Question 28. How To Create A Cookie Using Vbscript?

Answer:

The handiest manner to create a cookie is to assign a string price to the file.Cookie object, which looks as if this:

Syntax:

document.Cookie = “key1 = value1; key2 = value2; expires = date”;

Here expires characteristic is non-obligatory. If you provide this attribute with a legitimate date or time then cookie will expire at the given date or time and after that cookies’ value will now not be reachable.

Question: 29. How To Read A Cookie Using Vbscript?

Answer:

Reading a cookie is simply as simple as writing one, because the value of the report.Cookie object is the cookie. So you may use this string each time you want to get admission to the cookie.

The report.Cookie string will keep a listing of name=value pairs separated through semicolons, where call is the name of a cookie and fee is its string cost.

You can use strings’ split() characteristic to interrupt the string into key and values.

Microsoft Visual C++ Interview Questions
Question 30. How To Delete A Cookie Using Vbscript?

Answer:

Sometimes you will need to delete a cookie so that next attempts to examine the cookie return nothing. To try this, you simply want to set the expiration date to a time in the beyond.

Question: 31. How Will You Convert A Given Number To Double In Vbscript?

Answer:

Using CDbl characteristic, which converts a given wide variety of any variant subtype to double.

Example:

x = 123
y = 123.882
record.Write(“x fee after changing to double – ” & CDbl(x) & “
“)

Question: 32. How Will You Convert A Given Number To Integer In Vbscript?

Answer:

Using CInt feature, which converts a given wide variety of any version subtype to Integer.

Example:

x = 123
y = 123.882
report.Write(“y fee after changing to Int – ” & CInt(y) & “
“)

TypeScript Interview Questions
Question 33. How Will You Convert A Given Number To Long In Vbscript?

Answer:

Using CLng feature, which converts a given number of any variation subtype to Long.

Example:

x = 123
y = 123.882
file.Write(“x value after changing to Long -” & CLng(x) & “
“)

ActiveX Interview Questions
Question 34. How Will You Convert A Given Number To Single In Vbscript?

Answer:

Using CSng function, which converts a given wide variety of any version subtype to Single.

Example:

x = 123
y = 123.882
report.Write(“x fee after converting to Single -” & CSng(x) & “
“)

Question: 35. How Will You Convert A Given Number To Hexadecimal In Vbscript?

Answer:

Using Hex characteristic, which converts a given variety of any version subtype to Hexadecimal.

Example:

x = 123
y = 123.882
document.Write(“y fee after converting to Hex -” & Hex(y) & “
“)

Question: 36. How Will You Format A Number Upto 3 Decimal Places In Vbscript?

Answer:

Using FormatNumber feature, which could go back an expression formatted as a number of.

Example:

Dim num : num = -645.998651
record.Write(FormatNumber(num, three))& “
”     ‘-645.999

Software checking out Interview Questions
Question 37. How Will You Format A Number In Percetage Format In Vbscript?

Answer:

Using FormatPercent characteristic, which might return an expression formatted as a percent.

Example:

Dim num : num = -645.998651
report.Write(FormatPercent(num, 2))& “
”    ‘-64,599.86%

Question: 38. How Will You Get The Integer Part Of A Number In Vbscript?

Answer:

Using Int function, which returns the integer part of the given quantity.

Example:

Dim num : num = -645.998651
file.Write(“int Result of num is : ” & int(num))& “
”  ‘-646

Question: 39. How Will You Get The Natural Logarithm Of The Given Number In Vbscript?

Answer:

Using Log function, which returns the herbal logarithm of the given range.

Example:

Dim num : num = 210
report.Write(“Log Result of num2 is : ” & Log(num2))& “
” ‘5.34710753071747

Question: 40. How Will You Get The Octal Value Of The Given Number In Vbscript?

Answer:

Using Oct characteristic, which returns the octal value of the given variety.

Example:

Dim num : num = -645.998651
report.Write(“Oct Result of num is : ” & Oct(num))& “
” ‘37777776572

Test Cases Interview Questions
Question forty one. How Will You Get The Hexadecimal Value Of The Given Number In Vbscript?

Answer:

Using Hex characteristic, which returns the hexadecimal cost of the given quantity.

Example:

Dim num : num = -645.998651
record.Write(“Hex Result of num is : ” & Hex(num))& “
” ‘FFFFFD7A

Question: 42. How Will You Get A Random Number Between zero And 1 In Vbscript?

Answer:

Using Rnd characteristic,which returns a random number between zero and 1.

Example:

Dim num : num = -645.998651
record.Write(“Rnd Result of num is : ” & Rnd(num))& “
” ‘0.5130115

Software Development Lifecycle (SDLC) Interview Questions
Question 43. How Will You Get The Square Root Of The Given Number In Vbscript?

Answer:

Using Sqr characteristic, which returns the rectangular root of the given variety.

Example:

Dim num : num = -210
report.Write(“Sqr Result of num is : ” & Sqr(num))& “
” ‘14.4913767461894

Question: 44. How Will You Get The Absolute Value Of The Given Number In Vbscript?

Answer:

Using Abs feature, which returns absolutely the price of the given wide variety.

Example:

Dim num : num = -645.998651
document.Write(“Abs Result of num is : ” & Abs(num))& “
” ‘645.998651

Question: forty five. How Will You Get The Exponent Of The Given Number In Vbscript?

Answer:

Using Exp function, which returns the cost of e raised to the desired wide variety.

Example:

Dim num : num = -645.998651
document.Write(“Exp Result of num is : ” & Exp(num))& “
” ‘2.79479883633128E-281

Question: 46. How Will You Get The First Occurrence Of One String Within Another String Using Vbscript?

Answer:

Using InStr characteristic, which returns the first prevalence of one string inside every other string. The seek takes place from left to proper.

Question: forty seven. How Will You Get The Last Occurrence Of One String Within Another String Using Vbscript?

Answer:

Using InStrRev characteristic, which returns the primary occurrence of 1 string inside some other string. The search happens from right to left.

Question: forty eight. How Will You Convert A String To Lower Case String Using Vbscript?

Answer:

Using Lcase characteristic, which returns the decrease case of the desired string.

Question: 49. How Will You Convert A String To Upper Case String Using Vbscript?

Answer:

Using Ucase feature, which returns the higher case of the required string.

Question: 50. How Will You Trim The Spaces On The Left Of A String Using Vbscript?

Answer:

Using Ltrim characteristic, which returns a string after disposing of the areas at the left facet of the desired string.

  300+ Salesforce Admin FAQs and Answers [Experienced / Freshers]

Question: fifty one. How Will You Trim The Spaces On The Right Of A String Using Vbscript?

Answer:

Using Rtrim feature, which returns a string after getting rid of the spaces on the left side of the required string.

Question: 52. How Will You Trim The Leading As Well As Trailing Spaces Of A String Using Vbscript?

Answer:

Using Trim feature, which returns a string fee after disposing of each leading and trailing clean areas.

Question: fifty three. How Will You Get Length Of A String Using Vbscript?

Answer:

Using Len characteristic, which returns the duration of the given string.

Question: fifty four. How Will You Replace A String With Another String Using Vbscript?

Answer:

Using Replace function, which returns a string after changing a string with every other string.

Question: 55. How Will You Fill The String With The Specified Number Of Spaces Using Vbscript?

Answer:

Using Space function, which fills a string with the required variety of areas.

Question: 56. How Will You Compare Two Strings In Vbscript?

Answer:

Using StrComp feature, which returns an integer price after comparing the two specified strings.

Question: 57. How Strcomp Function Works?

Answer:

The StrComp Function returns an integer fee after comparing the two given strings. It can go back any of the 3 values -1, zero or 1 based totally at the input strings to be as compared.

If String 1 < String 2 then StrComp returns -1
If String 1 = String 2 then StrComp returns 0
If String 1 > String 2 then StrComp returns 1
Question fifty eight. How Will You Get A String With The Specified Character The Specified Number Of Times In Vbscript?

Answer:

Using String function, which returns a String with a special man or woman the desired variety of instances.

Question: 59. How Will You Reverse A String In Vbscript?

Answer:

Using StrReverse function, whihc returns a String after reversing the sequece of the characters of the given string.

Question: 60. How To Declare An Array In Vbscript?

Answer:

arrays are declared the same way a variable has been declared besides that the statement of an array variable makes use of parenthesis. In the under instance, the size of the array is referred to within the brackets.

Example:

‘Method 1 : Using Dim
Dim arr1() ‘Without Size
‘Method 2 : Mentioning the Size
Dim arr2(5)  ‘Declared with size of 5
‘Method 3 : the use of ‘Array’ Parameter
Dim arr3
arr3 = Array(“apple”,”Orange”,”Grapes”)

Question: sixty one. How Will You Assign Values To An Array In Vbscript?

Answer:

The values are assigned to the array with the aid of specifying array index cost in opposition to every one of the values to be assigned.

Example:

Dim arr(5)
arr(0) = “VBScript”    ‘String
file.Write(“Value stored in Array index zero : ” & arr(zero) & “
“)

Question: 62. How Will You Increase The Size Of An Array In Vbscript?

Answer:

Using ReDim statement, we will claim dynamic-array variables and allocate or reallocate garage space.

Question: 63. How Will You Get The Smallest Subscript Of An Array In Vbscript?

Answer:

Using LBound feature, which returns an integer that corresponds to the smallest subscript of the given arrays.

Question: 64. How Will You Get The Largest Subscript Of An Array In Vbscript?

Answer:

Using UBound feature, which returns an integer that corresponds to the most important subscript of the given arrays.

Question: 65. How Will You Split A String Into An Array In Vbscript?

Answer:

Using Split feature, which returns an array that carries a targeted number of values. Splitted primarily based on a Delimiter.

Question: 66. How Will You Get A Combined String From Array Of String In Vbscript?

Answer:

Using Join characteristic, which returns a String that carries a specific wide variety of substrings in an array. This is an precise opposite function of Split Method.

Question: sixty seven. How Will You Get A Subset Of A Array In Vbscript?

Answer:

Using Filter feature, returns a 0 based totally array that includes a subset of a string array based totally on a specific clear out criteria.

Question: sixty eight. How Will You Check That A Variable Is An Array In Vbscript?

Answer:

Using IsArray function, which returns a boolean fee that shows whether or now not the input variable is an array.

Question: sixty nine. How Will You Release The Memory Acquired By An Array Variable In Vbscript?

Answer:

Using Erase Function, which recovers the allocated reminiscence for the array variables.

Question: 70. How To Create A Function In Vbscript?

Answer:

The maximum not unusual manner to define a characteristic in VBScript is with the aid of the usage of the Function key-word, followed by using a unique function call and it can or may not carry a listing of parameters and a announcement with a End Function keyword, which shows the cease of the feature.

Question: 71. How To Call A Function In Vbscript?

Answer:

To invoke a function someplace later within the script, you would easy need to put in writing the name of that characteristic with the Call key-word.

Question: 72. How To Return A Value From A Function In Vbscript?

Answer:

To go back a cost from a function, in reality assign the cost to the characteristic name itself.

Question: 73. Can In Vbscript, Function Return Multiple Values?

Answer:

Yes! A characteristic can go back a couple of values separated via comma as an array assigned to the function call itself.

Question: seventy four. What Are Subprocedures In Vbscript?

Answer:

Sub Procedures are much like features but there are few variations.
Sub tactics DONOT Return a price while capabilities can also or might not return a fee.
Sub tactics Can be referred to as without call key-word.
Sub approaches are usually enclosed within Sub and End Sub statements.
Question 75. How To Pass Argument By Value To A Function In Vbscript?

Answer:

If ByVal is designated, then the arguments are despatched as by using cost whilst the feature or technique is referred to as.

Question: 76. How To Pass Argument By Reference To A Function In Vbscript?

Answer:

If ByRef is unique, then the arguments are sent as by way of reference whilst the function or technique is called.

Question: 77. How Can You Create An Object In Vbscript?

Answer:

we want to declare the object and instantiate it the usage of Set Keyword.

Example:

Dim obj  
Set obj = CreateObject(“Scripting.Dictionary”)

Question: seventy eight. How Can You Destroy An Object In Vbscript?

Answer:

In order to ruin the objects, we need to use Set Keyword followed with the aid of the object call and factor it to Nothing.

Example:

Dim obj  
Set obj = CreateObject(“Scripting.Dictionary”)
Set obj = Nothing

Question: 79. What Is A Class In Vbscript?

  [PDF] Mumbai Property Tax | Calculation, Penalty Charges, Due Dates, Rebate and Receipts

Answer:

Class is a construct this is used to define a unique type. Like Object Oriented Programming, VbScript five.0 supports the advent of training and it’s miles very much like writing COM gadgets with VB.

Class is simply the template for an item and we instantiate an item to get right of entry to the homes and strategies of it. Classes can comprise variables, homes, methods or activities.

Question: eighty. How To Create A Class In Vbscript?

Answer:

VBScript classes are enclosed within Class …. End Class
‘Defining the Class
Class classname    ‘Declare the item call

End Class
‘ Instantiation of the Class
Set objectname = new classname

Question: 81. What Are Class Variables?

Answer:

Classes can incorporate variables, which can be of private or public. Variables within lessons must observe VBScript naming conventions. By default, the variables in elegance are Public. That is why they may be accessed out of doors the class.

Example:

Dim var1 , var2.
Private var1 , var2.
Public var1 , var2.

Question: 82. What Are Class Properties?

Answer:

Class residences, such as Property Let, which handles the manner of statistics validation and assigning the new value to the personal variable. Property set, which assigns the new belongings fee to the personal object variable.

Read-only houses have best a Property Get system while write-handiest residences (which might be uncommon) have handiest a Property Let or a Property Set procedure.

Example:

Class Comp
   
   Private modStrType
   Private OS
 
   Public Property Let ComputerType(strType)
      modStrType = strType
   End Property
 
   Public Property Get ComputerType()
      ComputerType = modStrType
   End Property
 
   Public Property Set OperatingSystem(oObj)
      Set OS = oObj
   End Property
 
   Public Property Get OperatingSystem()
      Set OperatingSystem = OS
   End Property
 
End Class

Question: eighty three. What Are Class Methods?

Answer:

Methods allow the elegance to carry out the operation that the developer desires. The Methods are nothing however Functions or Subroutines.

Example:

Class Car   
   Private Model
   Private Year 
   Public Start()
      Fuel = 2.Forty five
   Pressure =  4.15
   End Function 
End Class

Question: eighty four. What Are Class Events?

Answer:

There are  activities which can be robotically related to each class by default. Class_Initialize and Class_Terminate.

Class_Initialize is precipitated every time you instantiate an object based totally on the elegance. Class_Terminate occasion is fired whilst the item is going out of scope or while the item is about to Nothing.

Example:

In the below instance, we will make you apprehend how the activities work in VBScript.

‘Instantation of the Object
Set objectname = New classname 
   
Private Sub Class_Initialize(  )
 Initalization code goes right here
End Sub
‘When Object is Set to Nothing
Private Sub Class_Terminate(  )
 Termination code is going here
End Sub

Question: 85. What Is Purpose Of Scripting.Filesystemobject Class In Vbscript?

Answer:

This class offers report gadget items which assist the builders to paintings with drives, folders and documents.

Example:

Dim oFS, pressure
Set oFS = CreateObject(“Scripting.FileSystemObject”)
Set pressure = oFS.GetDrive(oFS.GetDriveName(“C:”))
Document.Write drive.VolumeName

Question: 86. What Is The Purpose Of Drive Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

Drive consists of techniques and homes that let you acquire data approximately a pressure connected to the machine.

Question: 87. What Is The Purpose Of File Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

File incorporates techniques and properties that allow builders to create, delete or flow a report.

Question: 88. What Is The Purpose Of Files Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

Files provides a list of all documents contained inside a folder.

Question: 89. What Is The Purpose Of Folder Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

Folder presents techniques and residences that allow developers to create, delete or pass folders.

Question: ninety. What Is The Purpose Of Folders Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

Folders gives a list of all the folders within a Folder.

Question: 91. What Is The Purpose Of Textstream Object Of Scripting.Filesystemobject Class In Vbscript?

Answer:

TextStream enables builders to study and write textual content files.

Question: 92. What Is The Purpose Of Regexp Object In Vbscript?

Answer:

RegExp item enables the developers to match the sample of strings and the residences and techniques assist us to paintings with Regular Expressions effortlessly.

Question: 93. What Are The Properties Of Regexp Object?

Answer:

Following are the homes of RegExp object:

Pattern: The Pattern technique represents a string that is used to define the everyday expression and it ought to be set earlier than the use of the everyday expression object.

IgnoreCase: A Boolean belongings that represents if the ordinary expression have to be examined against all viable matches in a string if genuine or false. If no longer targeted explicitly, IgnoreCase price is about to False.

Global: A Boolean assets that represents if the everyday expression must be examined against all possible suits in a string. If not unique explicitly, Global price is about to False.

Question: 94. How Regexp.Test Method Works?

Answer:

The Test approach takes a string as its argument and returns True if the regular expression can effectively be matched in opposition to the string, otherwise False is lower back.

Question: 95. How Regexp.Replace Method Works?

Answer:

The Replace method takes 2 parameters. If the hunt is a success then it replaces that match with the update-string, and the new string is lower back. If there are no suits then the original seek-string is lower back.

Question: 96. How Regexp.Execute Method Works?

Answer:

The Execute approach works like Replace, besides that it returns a Matches collection item, containing a Match item for each successful match. It would not alter the unique string.

Question: ninety seven. How To Capture A Runtime Error In Vbscript?

Answer:

If we want to seize the error, then Err Object is used.

Question: 98. How To Throw An Error In Vbscript?

Answer:

Use Err.Raise to throw an errors.

Example:

Err.Raise 6   ‘ Raise an overflow blunders.

Question: 99. How To Get The Error Details In Vbscript?

Answer:

Err.Number gives the error range and Err.Description gives error description.

Example:

Err.Raise 6   ‘ Raise an overflow blunders.
MsgBox “Error # ” & CStr(Err.Number) & ” ” & Err.Description

Question: one hundred. How To Clear An Error In Vbscript?

Answer:

Err.Clear clear an errors.

Example:

Err.Raise 6   ‘ Raise an overflow mistakes.
MsgBox “Error # ” & CStr(Err.Number) & ” ” & Err.Description
Err.Clear   ‘ Clear the mistake.

allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen=””>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top