Your Ad Here

Sunday, January 11, 2009

Latest VB script Interview Questions & Answers

Q : What are the major differences between Visual Basic and VBScript?
A : They are different: You dont compile VB scripts like in Visual Basic. You just distribute them as plain text HTML files.The script engine interprets this text into intermediate code when it loads the Web page. It also creates a symbol table so that it can quickly look up things such as event-procedures and variable names. The scripting engine uses the ActiveX Scripting technology to interact with the browser.
IE supports VB scripts on your computer& we can create Web pages with VB scripts. For Visual Basic, you need a text editor,ActiveX,Control Pad and Web Browser.
Some other differences:

Debugging VBScript doesn't have a debugger like Visual Basic. You'll resort to using lots of message boxes, instead.

Event-handlers You don't have an editor in which you select an object and event to edit an event-procedure. You have to name event-procedures in your scripts so that the scripting engine can find the appropriate handler when an object fires an event.

Forms VBScript doesn't have a forms editor. It doesn't need one, because you can't display forms anyway. You put forms and controls on the Web page, instead. You can use the ActiveX Control pad to insert all those nasty tags in your Web page, however.

Q : What are the types of arrays handled by VBScript?
A : .Static array2.Dynamic array ...

Q : What is the use of ReDim statement in VBScript?
A : The ReDim statement is used to change the size of the array within the script:
for example you have declared an array
Dim Customers(50)
But now you want to change the size of the array so you can do that with the help of Redim

ReDim Customers(100)

Q : What is parametrization ?
A : Parametrization: where you can change object's parameters in accordance with a mathematical rule, or data from a file.

Q : Compare Java Script and VB Script?
A : VB and Java Script are much similar in functionality. They both interact with the document object model of the page. Many browsers have compatibility with Java Script but they are not compatible with VB script as such. For client side scripting developers using VB Script should always make sure of cross browser compatibility which is not the case when working with VB script.

Q : Explain about operator precedence in VB Script?
A : In operator precedence expressions are evaluated and resolved in a predetermined order. The order of evaluation can be modulated if you use parenthesis. Expressions present in parenthesis are evaluated first.

Q : Explain about .wsf files?
A : .wsf files are modeled in similar to XML. They can be executed with the help of Wscript.exe and it can be done from the command line also. This .wsf file can have multiple visual basic files. Reuse functionality is present with this extension file.

Q : Explain about ADODB.Stream class?
ADODB.Stream class can be used as string builder. VBScript string concatenation can be very costly because of frequent memory allocation features. Binary file and memory I/O operation is provided by ADODB.Stream class. This is widely used to convert bytes into string, etc.

Q : Explain about filter expression?
A : Filter expression returns an array based on a specific filter search condition and it returns a zero based array. Arguments included in the filter array are Input strings, value, include and compare. If there is no match for the value it returns an empty string.

0 comments:

Your Ad Here