Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Line number
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Identifier of a sequence of characters in a text file}} In [[computing]], a '''line number''' is a method used to specify a particular sequence of characters in a [[text file]]. The most common method of assigning numbers to lines is to assign every [[line (text file)|line]] a unique number, starting at 1 for the first line, and incrementing by 1 for each successive line. In the [[C (programming language)|C]] [[programming language]] the line number of a [[source code]] line is one greater than the number of [[new-line]] characters read or introduced up to that point.<ref>{{cite web|url=http://c0x.coding-guidelines.com/6.10.4.html|title=6.10.4 Line control|date=2008-01-30|accessdate=2008-07-03|author=|archive-date=2011-07-08|archive-url=https://web.archive.org/web/20110708174323/http://c0x.coding-guidelines.com/6.10.4.html|url-status=dead}}</ref> Programmers could also assign line numbers to statements in older [[programming languages]], such as [[Fortran]], [[JOSS]], and [[BASIC]]. In Fortran, not every statement needed a line number, and line numbers did not have to be in sequential order. The purpose of line numbers was for branching and for reference by formatting statements. Both JOSS and BASIC made line numbers a required element of [[syntax]]. The primary reason for this is that most [[operating systems]] at the time lacked interactive [[text editors]]; since the programmer's interface was usually limited to a [[line editor]], line numbers provided a mechanism by which specific lines in the [[source code]] could be referenced for editing, and by which the programmer could insert a new line at a specific point. Line numbers also provided a convenient means of distinguishing between code to be entered into the program and [[direct mode]] commands to be executed immediately when entered by the user (which do not have line numbers). Largely due to the prevalence of interactive text editing in modern [[operating system]]s, line numbers are not a feature of most programming languages, even modern Fortran and Basic.<ref name="GBvsQB">{{cite web|url=http://support.microsoft.com/kb/73084|title=Differences Between GW-BASIC and QBasic|date=2003-05-12|accessdate=2008-06-28|author=}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)