| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Pl/I |
In a message dated 01-18-99, Murray Lesser said to Francois Thunus about
"Pl/I"
ML>for my reply to Eddy's question. For late entrants to this thread, here
ML>is a repeat of the PL/I code in question:
Perhaps some annotation would clarify exactly what Murray wrote.
ML>*process langlvl(saa2), limits(extname(31)), libs, not('^');
The above line contains only compilation options after the "*PROCESS"
introducer. It is not really part of the source code. It could just as
easily be put onto the command line that invokes the compiler, but this way
the options are bundled with the program for future reference.
ML> toupper: proc(infile) options (main noexecops);
The above is a statement bracket that starts a function, subroutine or main
program. The "MAIN" in the OPTIONS() list indicates that it is
the last. The
name of the routine is "toupper" and it has a single argument named
"infile".
For complete optimization he should also have had REORDER in the OPTIONS()
list. This allows the compiler to alter the conceptual order of statements,
after performing a flow analysis of the execution logic, to improve the
performance of a program. [In this case, it wouldn't make a blind bit of
difference, as the program has only 1 executable statement.]
ML> dcl infile char(100) var;
The above line is the specification of the attributes of the argument. It is
a character string whose length can vary from 0 to 100 bytes.
ML> dcl translate builtin;
ML> dcl (From value('abcdefghijklmnopqrstuvwxyz'),
ML> To value('ABCDEFGHIJKLMNOPQRSTUVWXYZ')) char(26);
The above three lines are two declarations. The first tells the compiler
that references to TRANSLATE() are for the built-in function. The second
defines 2 named constants, each a character string of length 26 bytes.
ML> display (translate(infile,to,from));
The above line does all the work.
ML> end toupper;
And this is a closing statement bracket that matches the PROC statement at
the top. It includes the name of the PROC and the compiler will check that
the level of closure matches the level of statement bracket at which that
name was defined. It is left to your imagination as to what happens if there
is a mismatch.
Regards
Dave
___
* MR/2 2.25 #353 * Evil I did dwell, lewd did I live.
--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-717904) (2:440/4)SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252 SEEN-BY: 670/218 @PATH: 440/4 255/1 251/25 396/1 633/260 635/506 728 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.