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!
===File type=== :<syntaxhighlight lang="pascal"> type a = file of integer; b = record x : integer; y : char end; c = file of b; </syntaxhighlight> As shown in the example above, Pascal [[Computer file|files]] are sequences of components. Every file has a buffer variable which is denoted by ''f^''. The procedures ''get'' (for reading) and ''put'' (for writing) move the buffer variable to the next element. Read is introduced such that ''read(f, x)'' is the same as ''x := f^; get(f);''. Write is introduced such that ''write(f, x)'' is the same as ''f^ := x; put(f);'' The type {{code|text}} is predefined as file of char. While the buffer variable could be used for inspecting the next character to be used (check for a digit before reading an integer), this leads to serious problems with interactive programs in early implementations, but was solved later with the "lazy I/O" concept, which waits until the file buffer variable is actually accessed before performing file operations.
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)