Search This Blog

Thursday 27 October 2011

Input & Output Functions in VBScript


Input & Output functions in VBScript:

To read input from keyboard,we can follow below syntax
                                   
Variable=Inputbox(“Msg”)

To display output on screen ,we can follow below syntax

                                    Msgbox(“msg”)           Message displayed.
                                    Msgbox(variable)        variables value displayed.
                                    Msgbox(“msg”&variable)       msg & variable should display.

                        EX:-    option explicit
                                    Dim x,y,z
                                    X=inputbox(“enter x value”)
                                    Y=inputbox(“Enter y value”)
                                    Z=cint(x)*cint(y)
                                    Msgbox(“Multipled value is=”&z)

NOTE:-
            In vbscript “+” operator is used for addition when given values are numbers. It is used for concatenation when given values are strings.

No comments:

Post a Comment