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
Turbo Pascal
(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!
== Syntax == * Pascal is not [[case-sensitive]]. * Historically, Pascal comments are enclosed <code>{ within pairs of braces }</code>, or <code>(* left parenthesis/asterisk and asterisk/right parenthesis pairs *)</code>, and these can span any number of lines. Later versions of Borland Pascal also supported C++-style comments <code>// preceded by two forward slashes </code>, which finish at the end of the line. * The syntax for the statement <code>case</code> is more flexible than standard Pascal. * Sets may only have up to 256 (2<sup>8</sup>) members. * The standard Pascal <code>String</code> preceded by a length byte is supported, and takes a fixed amount of storage; later versions added a more flexible null-terminated type, calling the older type "short string". Older source code which handles strings in non-standard ways (e.g., directly manipulating the length byte like <code>S[0]:=14</code> to truncate a string) must either have its strings declared as short strings, or be rewritten. This is the classic [["Hello, World!" program]] in Turbo Pascal: <syntaxhighlight lang="Pascal"> program HelloWorld; begin WriteLn('Hello World') end. </syntaxhighlight> This asks for a name and writes it back to the screen a hundred times: <syntaxhighlight lang="Pascal"> program WriteName; var i : Integer; {variable to be used for looping} Name : String; {declares the variable Name as a string} begin Write('Please tell me your name: '); ReadLn(Name); {ReadLn returns the string entered by the user} for i := 1 to 100 do begin WriteLn('Hello ', Name) end; readln; end. </syntaxhighlight>
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
Turbo Pascal
(section)
Add topic