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
Fortran
(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!
====Fixed layout and punched cards==== {{See also|Computer programming in the punched card era}} [[File:FortranCardPROJ039.agr.jpg|thumb|FORTRAN code on a [[punched card]], showing the specialized uses of columns 1–5, 6 and 73–80]] [[File:FortranCodingForm.png|thumb|A reproduction of a FORTRAN coding form, printed on paper and intended to be used by programmers to prepare programs for punching onto cards by [[keypunch]] operators. Now obsolete.]] Before the development of disk files, text editors and terminals, programs were most often entered on a [[keypunch]] keyboard onto 80-column [[punched card]]s, one line to a card. The resulting deck of cards would be fed into a card reader to be compiled. Punched card codes included no lower-case letters or many special characters, and special versions of the IBM 026 [[keypunch]] were offered that would correctly print the re-purposed special characters used in FORTRAN. Reflecting punched card input practice, Fortran programs were originally written in a fixed-column format, with the first 72 columns read into twelve 36-bit words. A letter "C" in column 1 caused the entire card to be treated as a comment and ignored by the compiler. Otherwise, the columns of the card were divided into four fields: * 1 to 5 were the label field: a sequence of digits here was taken as a label for use in DO or control statements such as GO TO and IF, or to identify a FORMAT statement referred to in a WRITE or READ statement. Leading zeros are ignored and 0 is not a valid label number. * 6 was a continuation field: a character other than a blank or a zero here caused the card to be taken as a continuation of the statement on the prior card. The continuation cards were usually numbered 1, 2, ''etc.'' and the starting card might therefore have zero in its continuation column—which is not a continuation of its preceding card. * 7 to 72 served as the statement field. * 73 to 80 were ignored (the IBM 704's [[IBM 711|card reader]] only used 72 columns).<ref>{{cite manual |url=http://www.bitsavers.org/pdf/ibm/7090/22-6528-4_7090Manual.pdf |archive-url=https://web.archive.org/web/20081201175757/http://bitsavers.org/pdf/ibm/7090/22-6528-4_7090Manual.pdf |archive-date=December 1, 2008 |url-status=live |title=Reference Manual, IBM 7090 Data Processing System |date=1961 |id=A22-6528-3}}</ref> Columns 73 to 80 could therefore be used for identification information, such as punching a sequence number or text, which could be used to re-order cards if a stack of cards was dropped; though in practice this was reserved for stable, production programs. An [[IBM 519]] could be used to copy a program deck and add sequence numbers. Some early compilers, e.g., the IBM 650's, had additional restrictions due to limitations on their card readers.<ref>{{cite manual |url= http://www.bitsavers.org/pdf/ibm/fortran/F28-8074-3_FORTRANII_GenInf.pdf |archive-url=https://web.archive.org/web/20050426055632/http://www.bitsavers.org/pdf/ibm/fortran/F28-8074-3_FORTRANII_GenInf.pdf |archive-date=April 26, 2005 |url-status=live |title=Fortran II General Information Manual |date=1963 |access-date=November 19, 2014 }}</ref> [[Keypunch]]es could be programmed to tab to column 7 and skip out after column 72. Later compilers relaxed most fixed-format restrictions, and the requirement was eliminated in the Fortran 90 standard. Within the statement field, [[whitespace character]]s (blanks) were ignored outside a text literal. This allowed omitting spaces between tokens for brevity or including spaces within identifiers for clarity. For example, {{code|AVG OF X}} was a valid identifier, equivalent to {{code|AVGOFX}}, and <syntaxhighlight lang="fortran" inline>101010DO101I=1,101</syntaxhighlight> was a valid statement, equivalent to <syntaxhighlight lang="fortranfixed" inline>10101 DO 101 I = 1, 101</syntaxhighlight> because the zero in column 6 is treated as if it were a space (!), while <syntaxhighlight lang="fortran" inline>101010DO101I=1.101</syntaxhighlight> was instead <syntaxhighlight lang="fortranfixed" inline>10101 DO101I = 1.101</syntaxhighlight>, the assignment of 1.101 to a variable called <syntaxhighlight lang="fortran" inline>DO101I</syntaxhighlight>. Note the slight visual difference between a comma and a period. [[Hollerith constant|Hollerith strings]], originally allowed only in FORMAT and DATA statements, were prefixed by a character count and the letter H (e.g., {{code|26HTHIS IS ALPHANUMERIC DATA.}}), allowing blanks to be retained within the character string. Miscounts were a problem.
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)