VBScript Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to VBScript Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : C

Explaination

Variables that are declared as 'Private' have scope only within that script in which they are declared. When declaring a variable of type 'Private', Dim keyword is replaced by 'Private'.

Q 2 - Which of the following is used to create a constant in VBScript?

A - constant

B - const

C - final

D - None of the above.

Answer : B

Explaination

Constants are declared using 'const' keyword.

Q 3 - Which of the following function of VBScript converts a given number of any variant subtype to Single?

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : D

Explaination

CSng function converts a given number of any variant subtype to Single.

Q 4 - How will you get the exponent of the given number in VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : B

Explaination

Using Exp function, which returns the value of e raised to the specified number.

Q 5 - What StrComp(String1, String2) returns if String1 is less than String2 in lexicographical order?

A - -1

B - 0

C - 1

D - None of the above.

Answer : A

Explaination

StrComp(String1, String2) returns -1 if String1 is less than String2 in lexicographical order.

Q 6 - How will you split a string into an array in VBScript?

A - Using ReDim statement

B - Using LBound function

C - Using UBound function

D - Using Split function

Answer : D

Explaination

Using Split function, which returns an array that contains a specified number of values. Split will be based on a Delimiter.

Answer : B

Explaination

To return a value from a function, simply assign the value to the function name itself.

Q 8 - Which of the following event is triggered when an object goes out of scope or when the object is set to Nothing in VBScript?

A - Class_Initialize

B - Class_Terminate

C - None of the above.

D - Both of the above.

Answer : B

Explaination

Class_Terminate is triggered when an object goes out of scope or when the object is set to Nothing.

Q 9 - Which of the following is used to capture a runtime Error in VBScript?

A - Err object.

B - Error object.

C - Both of the above.

D - None of the above.

Answer : A

Explaination

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

Q 10 - Which of the following is used to get error details in VBScript?

A - Err.Number

B - Err.Description

C - Both of the above.

D - None of the above.

Answer : C

Explaination

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


vbscript_questions_answers.htm

Advertisements