Question:

how to get input from keyboard in simple way.

by Guest3966  |  12 years, 9 month(s) ago

0 LIKES UnLike

how to get input from keyboard in simple way.

 Tags: input, Keyboard, Simple

   Report

1 ANSWERS

  1. amomipais82
    Hi There,
    While entering data at the command line for a script to use is sometimes helpful like we discussed in  How to use command line arguments in VBScript via the Wscript.Arguments Object. However, if you recall in a later blog entry, Using the windows file dialog box in VBScript to provide file selections and populate script options , I mentioned It’s sometimes just not practical! In that entry we discussed a slick way to use the standard windows functions to have a user select a file– but even that sometimes isn’t good enough. Sometimes you just need the user to enter other stuff into the program.

    Well, you can easily do this with in VBScript as well, and it’s just one line of code! You use the InputBox command and it’s that easy. You simply assign the return to a variable of your choosing and specify first a Prompt (or directions) to a user and then you optionally can specify a title for the window that will be displayed. Below is an example that places the return of the InputBox command in a variable called Str, displays a prompt saying “Your Prompt here.” and has “Window Title here” in the title bar.

    Str = Inputbox(”Your Prompt here.”, “Window Title here”)

    There are other options as well, but they are typically not used in most cases. More information can be obtained from Microsoft in their InputBox Function documentation.

    Hope it helps

Sign In or Sign Up now to answser this question!

Question Stats

Latest activity: 14 years, 6 month(s) ago.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.