This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


Updated In 6 Graphic
interactively reads in a character string.
requests input, displaying prompt as a "prompt".
InputString[prompt, init]
in a notebook front end uses init as the initial contents of the input field.
  • InputString returns what it reads as a string, without evaluation.
  • The operation of InputString may vary from one computer system to another. When a Mathematica front end is used, InputString typically works through a dialog box.
  • When no front end is used, InputString reads from standard input.
  • If the standard input is a file, then InputString returns EndOfFile if you try to read past the end of the file.
  • On systems with textual input, InputString[] uses ? as a prompt.
  • When InputString is evaluated, Mathematica stops until the input has been read.
  • With a notebook front end, InputString by default puts up a dialog window with a standard appearance.
  • The prompt given can be text, graphics or any expression.
  • InputString by default puts up a dialog in the middle of the main display screen. Explicit settings for WindowMargins override this.
  • The option FieldSize can be used to specify the size of the field used for input.
New in 1 | Last modified in 6