• VBScript FAQ2

    Posted on May 29, 2013 by in Desktop Engineering, Frequently Asked Interview Q's

    The following are Frequently Asked Questions on VBScript during an interview for Application Packaging/Scripting Position:
    The question and answers are being collected from Various blogs and Articles. My effort is confined to collecting as much material as possible from various sources and publishing it at once place.


    S No.

    Question

    Answer

    1

    What are the different types of operators and their order of precedence?  Order of evaluation of operators is, first arithmetic operators are evaluated, and comparison operators are evaluated next and at the last logical operators are evaluated at the last. In arithmetic operators negation, Exponentiation, multiplication and division, integer division, modulus arithmetic, addition and subtraction and string concatenation are provided.

    they are eight types of operators in c-program.
    * arithmetic operators
    * relational operators
    * logical operators
    * increment and decrement operators
    * bitwise operators
    * assignment operators
    * comma operators
    * conditional operators

    2

    What is The Difference Between a Sub-Procedure and a Function? Sub-Procedure and a Function, both have nearly same syntax and calling process. But Function can return a value

    Eg:
    Function SumOf2Num(VarA,VarB)
    VarC = VarA + VarB
    SumOf2Num = VarC
    End Function

    Dim result
    Result = SumOf2Num(23,55)
    Msgbox Result

    3

     Explain about scrrun.dll? Scripting Runtime library is very important for the functioning of Visual basic script because it gives much more functionality such as File management, text operations and file modification features. Scrrun.dll is used very much in programming VB.

    4

    Compare Java Script and VB Script?  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 java script.

    5

    What Is The Difference Between the Dim, Public, and Private Statements? Private statement variables are available only to the script in which they are declared.
    Public statement variables are available to all procedures in all scripts.
    Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.

    6

    Which Browsers Support VBScript? VBScript is a trademark of Microsoft Corporation and is only supported by Microsoft Internet Explorer 3.0+ and Microsoft Internet Information Server.

    7

    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.

    8

    Give examples where VB script can directly run on users system with Windows as OS? A simple example detailing the running of VB Script is by utilizing Windows Script host environment. Visual basic is a stand alone application which has a .vbs as extension. Input can be provided through graphical user interface and output can be obtained by Wscript.exe from dialog and input boxes. From command line it can be invoked by Cscript.exe.

    9

    Explain about constants in VB Script? There are many useful constants present in Visual basic script which you can use in your code. They ease your work load by remembering value and implementing in the code. Maintenance is easy with VB Script because it can easily change the feature of constants.

    10

    Is VBScript Better Than JavaScript? It depends what you would call better =). The only con is that you must be using Explorer to see the code execute, which may be annoying for Netscape users that rely on JavaScript. On the other hand, VBScript operates in much the same way as JavaScript as they are both interpretted by the browser. In addition, VBScript can accomplish the same tasks as JavaScript, plus, VBScript (and JScript) may also be applied to Microsoft web technologies like ASP. Generally, VBScript is also easier to learn then JavaScript.
    Be Sociable, Share!

    Written by

    View all articles by

    Email : [email protected]

    Leave a Reply