program tstchconcat;


%include 'ex:[22,320]string.pkg';

var
  typ1string1,string:packed array [1..15] of char;
  typ0string1:packed array [0..15] of char;
  singlechar:char;
  end_check:packed array [1..3] of char;
  i,len:integer;

begin
  writeln('begin test of Sconcat');
  writeln;
  writeln('begin type1 test of concat.');
  repeat
    writeln;
    write('enter first string : ');
    Sclear(typ1string1);
    Sread(input,typ1string1);
    Sclear(end_check);
    len := Slen(typ1string1);
    for i:=1 to 3 do
      end_check[i] := typ1string1[i];
    if (end_check <> 'end') and (end_check <> 'END') 
    then begin
         write('enter character to be appended : ');
         readln(singlechar);
         Schconcat(typ1string1,singlechar);
         writeln('"',typ1string1,'"');
         end
    else writeln('end of type1 schconcat test.');
  until (end_check = 'end') or (end_check = 'END');
  writeln;
  writeln('begin type0 test of concat.');
  repeat
    writeln;
    write('enter first string : ');
    Sread(input,typ0string1);
    for i:=1 to 3 do
      end_check[i] := typ0string1[i];
    if (end_check <> 'end') and (end_check <> 'END') 
    then begin
      write('enter character to be appended : ');
      readln(singlechar);
      Schconcat(typ0string1,singlechar);
      len := Slen(typ0string1); 
      for i:=1 to len do
        string[i]:=typ0string1[i];
      writeln('"',string,'"');
      Sclear(string);
      Sclear(typ0string1);
      end
    else writeln('end of type0 concat test.');
    until (end_check = 'end') or (end_check = 'END');
    writeln;
    writeln('end of tstconcat test.');
end.
