| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Pl/I |
Hello David!
13 Jan 99 21:55, David Noon wrote to Francois Thunus:
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
ML>> in Pascal :-).
FT>> Borland Pascal:
FT>> upcase();
DN> Not quite correct. The upcase() function only handles one character, just
DN> like the C toupper() function. Murray's program translates the entire
DN> string in a single function call.
DN> You are at least a FOR-loop short of a program there.
so much for not reading completely the problem before answering :-)
>----- Begin -----
function UpStr(instring:string):string;
var
i : byte;
begin
for i:=1 to length(instring) do
instring[i]:=upcase(instring[i]);
UpStr:=instring;
end;
>----- End -----
DN> It gets worse. The only way to get the parameter string without resorting
DN> to raw API calls is Paramstr(i), where each token of the parameter string
DN> has been parsed out. You have to put them back together again and you have
DN> lost the spacing information! Since, under OS/2, filenames can contain
DN> spaces and the spaces are significant (Murray's parameter is named
DN> 'infile', so I would infer it is the filename of an input file) you will
DN> not be able to get back to your original data in Pascal.
mmmm. I'm not sure I understand the probelm. what is preventing you from
using temp variable or to treat each chunk separately and then piece it
back
together ?
DN> * MR/2 2.25 #353 * Vegetarian (n): Indian word for "lousy hunter".
rotflmao !
-= Francois =-
Francois(at)telematique(dot)org
http://www.telematique.org/ft
I know nooooooooooooooooooooooooooooooooooothing.
--- GoldED 2.51.A1026+
* Origin: Xara Sto Pragma ! Gasperich - Luxembourg -> (FidoNet 2:270/25.2)SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252 SEEN-BY: 670/218 @PATH: 270/25 170/400 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™.