PL/I preprocessor: Difference between revisions

Content deleted Content added
Sanchb1 (talk | contribs)
External links: fixed date error
m Example: <source>
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=http://www.uni-muenster.de/ZIV.EberhardSturm/uio.cpy|accessdate=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></code> if omitted.
<source lang="rexx" line highlight="1,25,26">
<pre>
%uwrite:
procedure keys (File, From, Count);
Line 96:
%end;
%act uwrite;
</presource>
 
The statement {{code|uwrite file(file_name) from(var_str) count(64);}} generates the following:
<source lang="rexx">
<pre>
do;
dcl Count00001 fixed bin (15);
Count00001 = filewrite(file_name, ptradd(addr(var_str), 2), min(length(var_str), 64));
end;
</presource>
 
==Evolution==