Category : Pascal Source Code
Archive   : BOOST4.ZIP
Filename : XLAT.PAS

 
Output of file : XLAT.PAS contained in archive : BOOST4.ZIP
Program xlat;
uses BOSHARE, Crt;

var
s : String;

BEGIN

Writeln('< Adventures with Boosters'' Translate function >');
Writeln;

{ change all occurrences of one character to another }
s := 'Lo and behold! It looks like rain!';
writeln( s );
writeln( translate(s,'!','.','.'));
readln;

s := 'Niagara-Falls,-New-York Green-Bay,-Wisconsin';
writeln( s );

{ insert CR/LF }
Insert ( #13#10, s, pos(' ',s)+1 );

{ change separation characters to blanks }
s := translate( s, '-',' ', ' ');
writeln( s );
readln;

{ remove CR/LF }
s := translate( s, #13#10,'',' ');
writeln( s );
readln;

{ re-order characters in a string of non-duplicates }
s := 'orlandB';
writeln(s);
s := translate ( s, s, 'Borland', ' ');
writeln( s );
readln;

{ using the Pad character }
writeln;
writeln( translate( 'aei','eia','12','$' ) );
readln;

{ emulating the strip function }
writeln;
s := '--------123456--------';
writeln(s);
writeln( translate( s,'-','',' ') );
readln;

{ null input table }
writeln;
s := 'liftoff';
Writeln(s);
writeln( translate( 'liftoff','','123',' ') );
readln;

{ null input table and null output table }
Writeln;
Writeln(s);
writeln( translate( s,'','',' ') );
readln;

{ using the Pad character }
writeln;
s := 'Dollars and Sense';
Writeln(s);
writeln( translate( s,'sS','$','$' ) );
readln;

END.

  3 Responses to “Category : Pascal Source Code
Archive   : BOOST4.ZIP
Filename : XLAT.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/