| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Pl/I |
In a message dated 01-12-99, Francois Thunus said to Murray Lesser about
"Pl/I"
Hi Francois,
ML> *process langlvl(saa2), limits(extname(31)), libs, not('^');
ML> toupper: proc(infile) options (main noexecops);
ML> dcl infile char(100) var;
ML> dcl translate builtin;
ML> dcl (From value('abcdefghijklmnopqrstuvwxyz'),
ML> To value('ABCDEFGHIJKLMNOPQRSTUVWXYZ')) char(26);
ML> display (translate(infile,to,from));
ML> end toupper;
ML> I leave it as an exercise for the reader to write the equivalent in
ML> Pascal :-).
FT>Borland Pascal:
FT>upcase();
Not quite correct. The upcase() function only handles one character, just
like the C toupper() function. Murray's program translates the entire string
in a single function call.
You are at least a FOR-loop short of a program there.
FT>:-)
:-(
It gets worse. The only way to get the parameter string without resorting to
raw API calls is Paramstr(i), where each token of the parameter string has
been parsed out. You have to put them back together again and you have lost
the spacing information! Since, under OS/2, filenames can contain spaces and
the spaces are significant (Murray's parameter is named 'infile', so I would
infer it is the filename of an input file) you will not be able to get back
to your original data in Pascal.
Regards
Dave
___
* MR/2 2.25 #353 * Vegetarian (n): Indian word for "lousy hunter".
--- 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™.