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
Pascal (programming language)
(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!
===Type declarations=== Types can be defined from other types using type declarations: :<syntaxhighlight lang="pascal"> type x = integer; y = x; ... </syntaxhighlight> Further, complex types can be constructed from simple types: :<syntaxhighlight lang="pascal"> type a = array[1..10] of integer; b = record x : integer; y : char {extra semicolon not strictly required} end; c = file of a; </syntaxhighlight> Further, complex types can be constructed from other complex types recursively: :<syntaxhighlight lang="pascal"> const Jack = 11; Queen = 12; King = 13; Ace = 14; type valueType = 2..Ace; suitType = club, diamond, heart, spade; cardType = record suit: suitType; value: valueType; end; deckType = array [1..52] of cardType; person = record surname: packed array [1..20] of char; age: integer; end; table = record hands: array [1..3] of deckType; players: array [1..4] of person; end; </syntaxhighlight>
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)