$Line

$Line
is a global variable that specifies the number of the current input line.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

The value of $Line corresponds to the numbers in In and Out:

In[1]:=
Click for copyable input
Out[1]=

It is incremented for every line of input:

In[2]:=
Click for copyable input
Out[2]=

You can reset it:

In[3]:=
Click for copyable input
Out[3]=
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »