Category : Word Perfect
Archive   : EQUALIZE.ZIP
Filename : STRINGS.PAS
Output of file : STRINGS.PAS contained in archive : EQUALIZE.ZIP
interface
function r2str(x:real; m,n:byte):string;
procedure upper(var s; m,n:integer);
function str2r(x:string; var io:integer):real;
Function parse(data:string; var x:string):string;
implementation
function str2r(x:string; var io:integer):real;
{
....coverts from string to real
}
var r:real;
begin val(x,r,io); str2r:=r; end;
procedure upper(var s; m,n:integer);
{....converts a string/array to upper case starting at m for n chars}
var
i:integer;
a:array[1..255] of char absolute s;
begin
for i:=m to n+m do a[i]:=UpCase(a[i]);
end;
{--------}
function r2str(x:real; m,n:byte):string;
{
....converts a real to a string of width m:n
}
var s:string;
begin str(x:m:n,s); r2str:=s; end;
{----------}
Function parse(data:string; var x:string):string;
{
....extracts xxx from data returning result and also remainder
...."=(xxx,range)"
...."=xxx,"
....returns data in uppercase or ''
}
var
j:integer;
label
end_parse;
begin
x:='';
for j:=1 to length(data) do
case data[j] of
' ': ; {skip any embedded blanks}
'=','(': x:=''; {re-start the field}
',',')': goto end_parse; {end field delimiters}
else x:=x+data[j]; {good stuff}
end;{end case and j loop}
end_parse:
if (x<>'') then x:=copy(x,1,255);
upper(x[1],1,length(x));
parse:=x;
if (j
else x:='';
end;
{----------}
end.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/