Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Pascal (programming language)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
===Semicolons as statement separators=== Pascal adopted many language syntax features from the [[ALGOL]] language, including the use of a semicolon as a statement separator. This is in contrast to other languages, such as [[PL/I]] and [[C (programming language)|C]], which use the semicolon as a statement terminator. No semicolon is needed before the <code>end</code> keyword of a record type declaration, a block, or a ''case'' statement; before the <code>until</code> keyword of a repeat statement; and before the <code>else</code> keyword of an ''if'' statement. The presence of an extra semicolon was not permitted in early versions of Pascal. However, the addition of [[ALGOL]]-like empty statements in the 1973 ''Revised Report'' and later changes to the language in ISO 7185:1983 now allow for optional semicolons in most of these cases. A semicolon is still not permitted immediately before the <code>else</code> keyword in an ''if'' statement, because the <code>else</code> follows a single statement, not a statement sequence. In the case of nested ifs, a semicolon cannot be used to avoid the [[dangling else]] problem (where the inner if does not have an else, but the outer if does) by putatively terminating the nested if with a semicolon β this instead terminates both if clauses. Instead, an explicit <code>begin</code>...<code>end</code> block must be used.<ref>''Pascal,'' Nell Dale and Chip Weems, "Dangling Else", [https://books.google.com/books?id=5x2k4vWwn1wC&pg=PA160 p. 160β161] {{webarchive|url=https://web.archive.org/web/20170318223956/https://books.google.com/books?id=5x2k4vWwn1wC&pg=PA160 |date=2017-03-18}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Pascal (programming language)
(section)
Add topic