Category:PL/I: Difference between revisions

m
added whitespace and more indentation for bullet points, added additional verbiage.
m (add pointers and based)
m (added whitespace and more indentation for bullet points, added additional verbiage.)
Line 14:
 
PL/I is a general purpose programming language suitable for commercial, scientific, non-scientific, and system programming.
 
 
It provides the following data types:
 
::*   Floating-point,
::*   Decimal integer,
::*   Binary integer,
::*   Fixed-point decimal   (with fractional part),
::*   Fixed-point binary   (that is, with fractional part),
::*   Pointers,
::*   Character strings of two kinds:
::::#   fixed-length,   and
::::#   varying-length.
::*   Bit strings of two kinds:
::::#   fixed-length,   and
::::#   varying length.
 
<br>
The &nbsp; float, &nbsp; integer, &nbsp; and &nbsp; fixed-point &nbsp; types can be &nbsp; real &nbsp; or &nbsp; complex.
 
The float, integer,and fixed-point types can be real or complex.
 
Multiple precisions are available for binary fixed-point:
::* &nbsp; 8 bits,
::* &nbsp; 16 bits,
::* &nbsp; 32 bits, &nbsp; and
::* &nbsp; 64 bits.
 
 
Multiple precisions are available for floating point:
::* &nbsp; 32 bits,
::* &nbsp; 64 bits, &nbsp; and
::* &nbsp; 80 bits.
 
 
The language provides for static and dynamic arrays. &nbsp; Of the latter, there are &nbsp; automatic, &nbsp; controlled, &nbsp; and &nbsp; based.
Controlled can be applied to any data type, including scalar, structure, as well as arrays. &nbsp; With controlled, a push-down and pop-up stack is automatically used.
 
 
PL/I has four kinds of I/O:
::# &nbsp; For simple I/O commands, list-directed input and output requires only the names of the variables. &nbsp; Default format is used, based on the variable's declaration.
::# &nbsp; For simple I/O commands, data-directed input and output requires only the names of the variables. &nbsp; For this form, both the names of the variables and their values are transmitted.
::# &nbsp; When precise layouts of input and output data is required, edit-directed I/O is used. &nbsp; A format is specified by the user. &nbsp; The format is flexible, and permits the number of digits, and the number of places after the decimal point to be specified dynamically. &nbsp; The format may also be specified in picture form.
::# &nbsp; forFor files held on storage media, record-oriented transmission is often used, either for &nbsp; sequential &nbsp; or &nbsp; random access.
 
 
PL/I has built-in checking for such programmer conditions including
::* &nbsp; subscript-range checking,
::* &nbsp; floating-point overflow,
::* &nbsp; fixed-point overflow,
::* &nbsp; division by zero,
::* &nbsp; sub-string range checking, &nbsp; and
::* &nbsp; string-size checking.
 
<br>
Any of those may be enabled or disabled by the user.
 
When any of those conditions occurs, the user/programmer may trap them and recover from them and continue execution.
 
PL/I has a unique and powerful pre-processor which is a subset of the full PL/I language so it can be used to perform source file inclusion, conditional compilation, and macro expansion. &nbsp; The pre-processor keywords are prefixed with a &nbsp; <big>%</big> &nbsp; (percent symbol).
<br><br>