<s>
In	O
computing	O
,	O
a	O
line	B-Application
number	I-Application
is	O
a	O
method	O
used	O
to	O
specify	O
a	O
particular	O
sequence	O
of	O
characters	O
in	O
a	O
text	B-General_Concept
file	I-General_Concept
.	O
</s>
<s>
The	O
most	O
common	O
method	O
of	O
assigning	O
numbers	O
to	O
lines	O
is	O
to	O
assign	O
every	O
line	B-General_Concept
a	O
unique	O
number	O
,	O
starting	O
at	O
1	O
for	O
the	O
first	O
line	B-General_Concept
,	O
and	O
incrementing	O
by	O
1	O
for	O
each	O
successive	O
line	B-General_Concept
.	O
</s>
<s>
In	O
the	O
C	B-Language
programming	I-Language
language	I-Language
the	O
line	B-Application
number	I-Application
of	O
a	O
source	O
code	O
line	B-General_Concept
is	O
one	O
greater	O
than	O
the	O
number	O
of	O
new-line	O
characters	O
read	O
or	O
introduced	O
up	O
to	O
that	O
point	O
.	O
</s>
<s>
Programmers	O
could	O
also	O
assign	O
line	B-Application
numbers	I-Application
to	O
statements	O
in	O
older	O
programming	O
languages	O
,	O
such	O
as	O
Fortran	B-Application
,	O
JOSS	B-Language
,	O
and	O
BASIC	O
.	O
</s>
<s>
In	O
Fortran	B-Application
,	O
not	O
every	O
statement	O
needed	O
a	O
line	B-Application
number	I-Application
,	O
and	O
line	B-Application
numbers	I-Application
did	O
not	O
have	O
to	O
be	O
in	O
sequential	O
order	O
.	O
</s>
<s>
The	O
purpose	O
of	O
line	B-Application
numbers	I-Application
was	O
for	O
branching	O
and	O
for	O
reference	O
by	O
formatting	O
statements	O
.	O
</s>
<s>
Both	O
JOSS	B-Language
and	O
BASIC	O
made	O
line	B-Application
numbers	I-Application
a	O
required	O
element	O
of	O
syntax	B-Application
.	O
</s>
<s>
The	O
primary	O
reason	O
for	O
this	O
is	O
that	O
most	O
operating	B-General_Concept
systems	I-General_Concept
at	O
the	O
time	O
lacked	O
interactive	O
text	B-Application
editors	I-Application
;	O
since	O
the	O
programmer	O
's	O
interface	O
was	O
usually	O
limited	O
to	O
a	O
line	B-Application
editor	I-Application
,	O
line	B-Application
numbers	I-Application
provided	O
a	O
mechanism	O
by	O
which	O
specific	O
lines	O
in	O
the	O
source	O
code	O
could	O
be	O
referenced	O
for	O
editing	O
,	O
and	O
by	O
which	O
the	O
programmer	O
could	O
insert	O
a	O
new	O
line	B-General_Concept
at	O
a	O
specific	O
point	O
.	O
</s>
<s>
Line	B-Application
numbers	I-Application
also	O
provided	O
a	O
convenient	O
means	O
of	O
distinguishing	O
between	O
code	O
to	O
be	O
entered	O
into	O
the	O
program	O
and	O
direct	B-Application
mode	I-Application
commands	O
to	O
be	O
executed	O
immediately	O
when	O
entered	O
by	O
the	O
user	O
(	O
which	O
do	O
not	O
have	O
line	B-Application
numbers	I-Application
)	O
.	O
</s>
<s>
Largely	O
due	O
to	O
the	O
prevalence	O
of	O
interactive	O
text	B-Application
editing	I-Application
in	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
,	O
line	B-Application
numbers	I-Application
are	O
not	O
a	O
feature	O
of	O
most	O
programming	O
languages	O
,	O
even	O
modern	O
Fortran	B-Application
and	O
Basic	O
.	O
</s>
<s>
In	O
Fortran	B-Application
,	O
as	O
first	O
specified	O
in	O
1956	O
,	O
line	B-Application
numbers	I-Application
were	O
used	O
to	O
define	O
input/output	O
patterns	O
,	O
to	O
specify	O
statements	O
to	O
be	O
repeated	O
,	O
and	O
for	O
conditional	O
branching	O
.	O
</s>
<s>
Like	O
assembler	B-Language
language	I-Language
before	O
it	O
,	O
Fortran	B-Application
did	O
not	O
assume	O
every	O
line	B-General_Concept
needed	O
a	O
label	O
(	O
line	B-Application
number	I-Application
,	O
in	O
this	O
case	O
)	O
.	O
</s>
<s>
Only	O
statements	O
referenced	O
elsewhere	O
required	O
a	O
line	B-Application
number	I-Application
:	O
</s>
<s>
Line	B-General_Concept
1	O
specifies	O
a	O
format	O
pattern	O
for	O
input	O
;	O
the	O
command	O
in	O
line	B-General_Concept
2	O
and	O
the	O
later	O
command	O
both	O
reference	O
this	O
line	B-General_Concept
.	O
</s>
<s>
The	O
loop	O
executes	O
line	B-General_Concept
3	O
.	O
</s>
<s>
The	O
arithmetic	B-Language
IF	I-Language
statement	O
branches	O
to	O
line	B-General_Concept
4	O
on	O
a	O
negative	O
value	O
,	O
line	B-General_Concept
3	O
on	O
zero	O
,	O
and	O
again	O
line	B-General_Concept
3	O
on	O
a	O
positive	O
value	O
.	O
</s>
<s>
While	O
the	O
line	B-Application
numbers	I-Application
are	O
sequential	O
in	O
this	O
example	O
,	O
in	O
the	O
very	O
first	O
"	O
complete	O
but	O
simple	O
 [ Fortran ] 	O
program	O
"	O
published	O
the	O
line	B-Application
numbers	I-Application
are	O
in	O
the	O
sequence	O
1	O
,	O
5	O
,	O
30	O
,	O
10	O
,	O
20	O
,	O
2	O
.	O
</s>
<s>
Line	B-Application
numbers	I-Application
could	O
also	O
be	O
assigned	O
to	O
fixed-point	O
variables	O
(	O
e.g.	O
,	O
i	O
n	O
)	O
for	O
referencing	O
in	O
subsequent	O
assigned	O
GO	O
TO	O
statements	O
(	O
e.g.	O
,	O
n	O
,	O
(	O
n1	O
,	O
n2	O
,...	O
nm	O
)	O
)	O
.	O
</s>
<s>
In	O
COBOL	B-Application
,	O
line	B-Application
numbers	I-Application
were	O
specified	O
in	O
the	O
first	O
six	O
characters	O
(	O
the	O
sequence	O
number	O
area	O
)	O
of	O
punched	B-Architecture
cards	I-Architecture
.	O
</s>
<s>
The	O
line	B-Application
numbers	I-Application
were	O
actually	O
ignored	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
In	O
1962	O
,	O
DOPE	B-Language
(	O
Dartmouth	O
Oversimplified	O
Programming	O
Experiment	O
)	O
became	O
one	O
of	O
the	O
first	O
programming	O
languages	O
to	O
require	O
a	O
line	B-Application
number	I-Application
for	O
every	O
statement	O
and	O
to	O
use	O
sequential	O
ordering	O
of	O
line	B-Application
numbers	I-Application
.	O
</s>
<s>
Line	B-Application
numbers	I-Application
were	O
specified	O
as	O
destinations	O
for	O
two	O
commands	O
,	O
C	B-Language
(	O
Compare	O
operation	O
,	O
an	O
arithmetic	B-Language
IF	I-Language
)	O
and	O
T	O
(	O
To	O
operation	O
,	O
a	O
GO	O
TO	O
)	O
.	O
</s>
<s>
In	O
1963	O
,	O
JOSS	B-Language
independently	O
made	O
line	B-Application
numbers	I-Application
mandatory	O
for	O
every	O
statement	O
in	O
a	O
program	O
and	O
ordered	O
lines	O
in	O
sequential	O
order	O
.	O
</s>
<s>
JOSS	B-Language
introduced	O
the	O
idea	O
of	O
a	O
single	O
command	B-Application
line	I-Application
editor	O
that	O
worked	O
both	O
as	O
an	O
interactive	O
language	O
and	O
a	O
program	O
editor	O
.	O
</s>
<s>
Commands	O
that	O
were	O
typed	O
without	O
a	O
line	B-Application
number	I-Application
were	O
executed	O
immediately	O
,	O
in	O
what	O
JOSS	B-Language
referred	O
to	O
as	O
"	O
direct	B-Application
mode	I-Application
"	O
.	O
</s>
<s>
If	O
the	O
same	O
line	B-General_Concept
was	O
prefixed	O
with	O
a	O
line	B-Application
number	I-Application
,	O
it	O
was	O
instead	O
copied	O
into	O
the	O
program	O
code	O
storage	O
area	O
,	O
which	O
JOSS	B-Language
called	O
"	O
indirect	O
mode	O
"	O
.	O
</s>
<s>
Unlike	O
FORTRAN	B-Application
before	O
it	O
or	O
BASIC	O
after	O
it	O
,	O
JOSS	B-Language
required	O
line	B-Application
numbers	I-Application
to	O
be	O
fixed-point	O
numbers	O
consisting	O
of	O
a	O
pair	O
of	O
two-digit	O
integers	O
separated	O
by	O
a	O
period	O
(	O
e.g.	O
,	O
1.1	O
)	O
.	O
</s>
<s>
The	O
portion	O
of	O
the	O
line	B-Application
number	I-Application
to	O
the	O
left	O
of	O
the	O
period	O
is	O
known	O
as	O
the	O
"	O
page	O
"	O
or	O
"	O
part	O
"	O
,	O
while	O
the	O
portion	O
to	O
the	O
right	O
is	O
known	O
as	O
the	O
"	O
line	B-General_Concept
"	O
;	O
for	O
example	O
,	O
the	O
line	B-Application
number	I-Application
refers	O
to	O
page	O
10	O
,	O
line	B-General_Concept
12	O
.	O
</s>
<s>
Branches	O
can	O
target	O
either	O
a	O
page	O
or	O
a	O
line	B-General_Concept
within	O
a	O
page	O
.	O
</s>
<s>
When	O
the	O
later	O
format	O
is	O
used	O
,	O
the	O
combined	O
page	O
and	O
line	B-General_Concept
is	O
known	O
as	O
a	O
"	O
step	O
"	O
.	O
</s>
<s>
Pages	O
are	O
used	O
to	O
define	O
subroutines	O
,	O
which	O
return	O
when	O
the	O
next	O
line	B-General_Concept
is	O
on	O
a	O
different	O
page	O
.	O
</s>
<s>
For	O
instance	O
,	O
if	O
a	O
subroutine	O
for	O
calculating	O
the	O
square	O
root	O
of	O
a	O
number	O
is	O
in	O
page	O
3	O
,	O
one	O
might	O
have	O
three	O
lines	O
of	O
code	O
3.1	O
,	O
3.2	O
and	O
3.3	O
,	O
and	O
it	O
would	O
be	O
called	O
using	O
The	O
code	O
would	O
return	O
to	O
the	O
statement	O
after	O
the	O
Do	O
when	O
it	O
reaches	O
the	O
next	O
line	B-General_Concept
on	O
a	O
different	O
page	O
,	O
for	O
instance	O
,	O
4.1	O
.	O
</s>
<s>
Introduced	O
in	O
1964	O
,	O
Dartmouth	B-Language
BASIC	I-Language
adopted	O
mandatory	O
line	B-Application
numbers	I-Application
,	O
as	O
in	O
JOSS	B-Language
,	O
but	O
made	O
them	O
integers	O
,	O
as	O
in	O
FORTRAN	B-Application
.	O
</s>
<s>
As	O
defined	O
initially	O
,	O
BASIC	O
only	O
used	O
line	B-Application
numbers	I-Application
for	O
and	O
(	O
go	O
to	O
subroutine	O
,	O
then	O
return	O
)	O
.	O
</s>
<s>
Some	O
Tiny	B-Language
BASIC	I-Language
implementations	O
supported	O
numeric	O
expressions	O
instead	O
of	O
constants	O
,	O
while	O
switch	O
statements	O
were	O
present	O
in	O
different	O
dialects	O
(	O
;	O
;	O
)	O
.	O
</s>
<s>
Line	B-Application
numbers	I-Application
were	O
rarely	O
used	O
elsewhere	O
.	O
</s>
<s>
One	O
exception	O
was	O
allowing	O
the	O
pointer	O
used	O
by	O
(	O
which	O
iterated	O
through	O
statements	O
)	O
to	O
be	O
set	O
to	O
a	O
specific	O
line	B-Application
number	I-Application
using	O
.	O
</s>
<s>
In	O
the	O
first	O
editions	O
of	O
Dartmouth	B-Language
BASIC	I-Language
,	O
could	O
only	O
be	O
followed	O
by	O
a	O
line	B-Application
number	I-Application
(	O
for	O
an	O
implied	O
GOTO	B-Application
)	O
,	O
not	O
-	O
as	O
in	O
later	O
implementations	O
-	O
by	O
a	O
statement	O
.	O
</s>
<s>
The	O
range	O
of	O
valid	O
line	B-Application
numbers	I-Application
varied	O
widely	O
from	O
implementation	O
to	O
implementation	O
,	O
depending	O
on	O
the	O
representation	O
used	O
to	O
store	O
the	O
binary	O
equivalent	O
of	O
the	O
line	B-Application
number	I-Application
(	O
one	O
or	O
two	O
bytes	O
;	O
signed	O
or	O
unsigned	O
)	O
.	O
</s>
<s>
While	O
Dartmouth	B-Language
BASIC	I-Language
supported	O
1	O
to	O
99999	O
,	O
the	O
typical	O
microcomputer	O
implementation	O
supported	O
1	O
to	O
32767	O
(	O
a	O
signed	O
16-bit	O
word	O
)	O
.	O
</s>
<s>
1	O
)	O
While	O
QBASIC	B-Language
does	O
make	O
use	O
of	O
structured	B-Language
programming	I-Language
and	O
thus	O
does	O
n't	O
need	O
line	B-Application
numbers	I-Application
,	O
it	O
is	O
still	O
possible	O
to	O
run	O
code	O
with	O
line	B-Application
numbers	I-Application
in	O
QBASIC	B-Language
.	O
</s>
<s>
It	O
was	O
a	O
matter	O
of	O
programming	B-Language
style	I-Language
,	O
if	O
not	O
outright	O
necessity	O
,	O
in	O
these	O
languages	O
to	O
leave	O
gaps	O
between	O
successive	O
line	B-Application
numbers	I-Application
—	O
i.e.	O
,	O
a	O
programmer	O
would	O
use	O
the	O
sequence	O
(	O
10	O
,	O
20	O
,	O
30	O
,...	O
)	O
rather	O
than	O
(	O
1	O
,	O
2	O
,	O
3	O
,...	O
)	O
.	O
</s>
<s>
This	O
permitted	O
the	O
programmer	O
to	O
insert	O
a	O
line	B-General_Concept
of	O
code	O
at	O
a	O
later	O
time	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
a	O
line	B-General_Concept
of	O
code	O
between	O
lines	O
20	O
and	O
30	O
was	O
left	O
out	O
,	O
the	O
programmer	O
might	O
insert	O
the	O
forgotten	O
line	B-General_Concept
at	O
line	B-Application
number	I-Application
25	O
.	O
</s>
<s>
If	O
no	O
gaps	O
were	O
left	O
in	O
the	O
numbering	O
,	O
the	O
programmer	O
would	O
be	O
required	O
to	O
renumber	B-Application
line	B-General_Concept
3	O
and	O
all	O
subsequent	O
lines	O
in	O
order	O
to	O
insert	O
the	O
new	O
line	B-General_Concept
after	O
line	B-General_Concept
2	O
.	O
</s>
<s>
Of	O
course	O
,	O
if	O
the	O
programmer	O
needed	O
to	O
insert	O
more	O
than	O
nine	O
additional	O
lines	O
,	O
renumbering	B-Application
would	O
be	O
required	O
even	O
with	O
the	O
sparser	O
numbering	O
.	O
</s>
<s>
However	O
,	O
this	O
renumbering	B-Application
would	O
be	O
limited	O
to	O
renumbering	B-Application
only	O
1	O
line	B-General_Concept
per	O
ten	O
lines	O
added	O
;	O
when	O
the	O
programmer	O
finds	O
they	O
need	O
to	O
add	O
a	O
line	B-General_Concept
between	O
29	O
and	O
30	O
,	O
only	O
line	B-General_Concept
30	O
would	O
need	O
to	O
be	O
renumbered	O
and	O
line	B-General_Concept
40	O
could	O
be	O
left	O
unchanged	O
.	O
</s>
<s>
Some	O
BASICs	O
had	O
a	O
command	O
,	O
which	O
typically	O
would	O
go	O
through	O
the	O
program	O
(	O
or	O
a	O
specified	O
portion	O
of	O
it	O
)	O
,	O
reassigning	O
line	B-Application
numbers	I-Application
in	O
equal	O
increments	O
.	O
</s>
<s>
It	O
would	O
also	O
renumber	B-Application
all	O
references	O
to	O
those	O
line	B-Application
numbers	I-Application
so	O
they	O
would	O
continue	O
to	O
work	O
properly	O
.	O
</s>
<s>
In	O
a	O
large	O
program	O
containing	O
subroutines	O
,	O
each	O
subroutine	O
would	O
usually	O
start	O
at	O
a	O
line	B-Application
number	I-Application
sufficiently	O
large	O
to	O
leave	O
room	O
for	O
expansion	O
of	O
the	O
main	O
program	O
(	O
and	O
previous	O
subroutines	O
)	O
.	O
</s>
<s>
In	O
"	O
unstructured	O
"	O
programming	O
languages	O
such	O
as	O
BASIC	O
,	O
line	B-Application
numbers	I-Application
were	O
used	O
to	O
specify	O
the	O
targets	O
of	O
branching	B-General_Concept
statements	I-General_Concept
.	O
</s>
<s>
GOTO-style	O
branching	O
can	O
lead	O
to	O
the	O
development	O
of	O
spaghetti	O
code	O
.	O
</s>
<s>
(	O
See	O
Considered	O
harmful	O
,	O
Structured	B-Language
programming	I-Language
.	O
)	O
</s>
<s>
Even	O
in	O
some	O
later	O
versions	O
of	O
BASIC	O
that	O
still	O
mandated	O
line	B-Application
numbers	I-Application
,	O
the	O
use	O
of	O
line	O
number-controlled	O
GOTOs	O
was	O
phased	O
out	O
whenever	O
possible	O
in	O
favor	O
of	O
cleaner	O
constructs	O
such	O
as	O
the	O
for	B-Language
loop	I-Language
and	O
while	O
loop	O
.	O
</s>
<s>
Many	O
modern	O
languages	O
(	O
including	O
C	B-Language
and	O
C++	B-Language
)	O
include	O
a	O
version	O
of	O
the	O
GOTO	B-Application
statement	O
;	O
however	O
,	O
in	O
these	O
languages	O
the	O
target	O
of	O
a	O
GOTO	B-Application
is	O
specified	O
by	O
a	O
line	B-General_Concept
label	O
instead	O
of	O
a	O
line	B-Application
number	I-Application
.	O
</s>
<s>
If	O
a	O
programmer	O
introduces	O
a	O
syntax	B-Application
error	I-Application
into	O
a	O
program	O
,	O
the	O
compiler	B-Language
(	O
or	O
interpreter	B-Application
)	O
will	O
inform	O
the	O
programmer	O
that	O
the	O
attempt	O
to	O
compile	B-Language
(	O
or	O
execute	O
)	O
failed	O
at	O
the	O
given	O
line	B-Application
number	I-Application
.	O
</s>
<s>
The	O
use	O
of	O
line	B-Application
numbers	I-Application
to	O
describe	O
the	O
location	O
of	O
errors	O
remains	O
standard	O
in	O
modern	O
programming	O
tools	O
,	O
even	O
though	O
line	B-Application
numbers	I-Application
are	O
never	O
required	O
to	O
be	O
manually	O
specified	O
.	O
</s>
<s>
It	O
is	O
a	O
simple	O
matter	O
for	O
a	O
program	O
to	O
count	O
the	O
newlines	O
in	O
a	O
source	O
file	O
and	O
display	O
an	O
automatically	O
generated	O
line	B-Application
number	I-Application
as	O
the	O
location	O
of	O
the	O
error	O
.	O
</s>
<s>
In	O
IDEs	B-Application
such	O
as	O
Microsoft	B-Application
Visual	I-Application
Studio	I-Application
,	O
Eclipse	O
or	O
Xcode	B-Operating_System
,	O
in	O
which	O
the	O
compiler	B-Language
is	O
usually	O
integrated	O
with	O
the	O
text	B-Application
editor	I-Application
,	O
the	O
programmer	O
can	O
even	O
double-click	O
on	O
an	O
error	O
and	O
be	O
taken	O
directly	O
to	O
the	O
line	B-General_Concept
containing	O
that	O
error	O
.	O
</s>
