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

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Using the Mathematica System /

1.3.3 Special Topic: Using a Text-Based Interface

With a text-based interface, you interact with Mathematica just by typing successive lines of input, and getting back successive lines of output on your screen.

At each stage, Mathematica prints a prompt of the form In[n]:= to tell you that it is ready to receive input. When you have entered your input, Mathematica processes it, and then displays the result with a label of the form Out[n]=.

If your input is short, then you can give it on a single line, ending the line by pressing Enter or Return. If your input is longer, you can give it on several lines. Mathematica will automatically continue reading successive lines until it has received a complete expression. Thus, for example, if you type an opening parenthesis on one line, Mathematica will go on reading successive lines of input until it sees the corresponding closing parenthesis. Note that if you enter a completely blank line, Mathematica will throw away the lines you have typed so far, and issue a new input prompt.

Retrieving and re-evaluating previous input and output.

With a text-based interface, each line of Mathematica input and output appears sequentially. Often your computer system will allow you to scroll backwards to review previous work, and to cut-and-paste previous lines of input.

But whatever kind of computer system you have, you can always use Mathematica to retrieve or re-evaluate previous input and output. In general, re-evaluating a particular piece of input or output may give you a different result than when you evaluated it in the first place. The reason is that in between you may have reset the values of variables that are used in that piece of input or output. If you ask for Out[n], then Mathematica will give you the final form of your n output. On the other hand, if you ask for In[n], then Mathematica will take the n input you gave, and re-evaluate it using whatever current assignments you have given for variables.