Sunday 12 March 2017

Inputbox in VB Script

Inputbox


Inputbox in VB Script is used for getting value from user.
In Inputbox, we can take numerical or alphabet values.
Ex-1
                var1=inputbox ("Enter your text")
                msgbox var1
Save this program as .vbs


Output-


After given input text


Ex-2
                 var1=cint(inputbox("Enter the first value for sum"))
                 var2=cint( inputbox ("Enter the second value for sum"))
                 sum=var1+var2
                 msgbox "Sum of two input value is = " &sum

Save this program as .vbs format
*Here "cint" is used for read value as numerical value, if you will not use cint or other data type then it will read the input values as string and give the result of these input as merge the two values.




No comments:

Post a Comment