CONCAT.I

[Table of Contents]


The CONCAT.I include file resides on the Kyan Pascal 2.x Disk #2. It includes one procedure that concatenates two string variables into a third string variable.


  • procedure CONCAT


Source Code


procedure concat(var a1,a2,a3:string);

var i,j:integer;

begin

i:=maxstring;
while ((a1[i] = ' ') and (i <> 1))
   do i:=i-1;

j:=1;
if (a1[i] <> ' ') then begin
   while (j <= i) do begin
      a3[j] := a1[j];
      j:=j+1;
   end;
end;

i:=1;
while (j <= maxstring) do begin
   a3[j] := a2[i];
   i:=i+1;
   j:=j+1;
end;

end;


No comments:

Post a Comment