Program TstString;

{ Version 1
  File:[22,310]TSTSTRING.PAS
  Author: Jim Bostwick 7-Sep-83
  History:


Testing P3UTIL module(s):  String Package

}

%INCLUDE EX:[22,320]GENERAL3.TYP;
%INCLUDE EX:[22,320]STRING.PKG; 

TYPE
  String = packed array [0..80] of char;

VAR
  Str1, Str2:String;	
  ch:char;
  c8:ch8;
  c5:ch5;

Begin
  { Sread test }
  Write('Type something, up to 80 characters:');
  Sread(input,Str1);
  Writeln('You just entered:');
  Swrite(output, Str1);
  Writeln;
  { slen test }
  Writeln('and the length is...',slen(str1));
  { again, with Type "1" string }
  Write('Type something else, up to 5 chars:');
  SCLEAR(C8);
  Sread(Input,c8);
  Writeln('That time you entered:');
  SWrite(Output,c8);
  Writeln(' and its length is ...',SLen(c8));
  Writeln(' Now to strut my stuff...');
  { SConcat test - concatenate second input to first }
  SConcat(Str1,' - ');
  SConcat(Str1,C8);
  SWrite(Output,Str1);
  Writeln(SLen(Str1));
  SDelete(Str1,5,5);
  SWrite(Output,Str1);
  Writeln;
  SInsert(Str1,'-*******-',5);
  SWrite(Output,Str1);
  Writeln;
  SClear(Str2);
  SClear(C8);
  Writeln('cleared strings have length:',SLen(Str2),SLen(c8));
  Sassign(C8,'12');
  SAssign(Str2,'12');
  if SEqual(Str2,c8) then writeln('12=12') else
     writeln('12 <> 12')
end.

