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 declared using 'Public' Keyword are available to all the procedures across all the associated scripts. When declaring a variable of type 'public', Dim keyword is replaced by 'Public'.

Q 2 - Which of the following operator can be used to do an XOR operation in VBScript?

A - ~

B - ^

C - XOR

D - None of the above.

Answer : C

Explaination

XOR is used to do an XOR operation.

Answer : A

Explaination

document.cookie = 'key1 = value1; key2 = value2; expires = date'; is the correct option.

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

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : A

Explaination

Using Abs function, which returns the absolute value of the given number.

Q 5 - How will you convert a string to upper case string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : B

Explaination

Using Ucase function, which returns the upper case of the specified string.

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.

Q 8 - Which of the following event is triggered when an object is instantiated in VBScript?

A - Class_Initialize

B - Class_Terminate

C - None of the above.

D - Both of the above.

Answer : A

Explaination

Class_Initialize is triggered whenever you instantiate an object based on the class.

Q 9 - Which of the following is used to throw an error in VBScript?

A - Err.raise

B - throw Err.

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Use Err.Raise to throw an error.

Answer : A

Explaination

The numeric values should be assigned without double quotes.

vbscript_questions_answers.htm
Advertisements