PL/I preprocessor: Difference between revisions

Content deleted Content added
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 13 templates: hyphenate params (7×);
Evolution: %THEN and %ELSE
 
(2 intermediate revisions by 2 users not shown)
Line 68:
 
==Example==
The following example for IBM PL/I for OS/2 illustrates the use of a preprocessor procedure to implement a C-like write statement for PL/I.<ref>{{cite web|last=Sturm|first=Eberhard|title=UIO-Makros für Builtin-Funktionen fileread und filewrite|url=httphttps://www.uni-muenster.de/ZIV.EberhardSturm/uio.cpy|access-date=January 22, 2012}}</ref> The procedure would be called by coding the statement {{code|uwrite file(filename) from(varying_string) count(byte_count);}} {{mono|<var>Byte_count</var>}} is optional and defaults to the length of {{mono|<var>varying_string</var>}} if omitted.
<syntaxhighlight lang="rexx" line highlight="1,25,26">
%uwrite:
Line 129:
* <code>RETURN</code> in a compile-time procedure only.
* <code>%INCLUDE</code>
* <code>%IF</code> &ndash; the <code>%IF <var>compile_time_comparison</var> %THEN <var>unit</var> [%ELSE <var>unit</var>]</code> was restored.
 
A single compile-time builtin, <code>SUBSTR</code>, was added.
Line 143:
==External links==
*{{cite web
|url = http://publibfp.boulder.ibm.com/cgi-binepubs/bookmgr/BOOKSpdf/ibm3lr80/21.0?DT=20091014225516pdf
|title = Enterprise PL/I Language Reference (SC27-1460-09): Chapter 21. Preprocessor Facilities
|author = IBM Corporation