Program TSTCWOTAS;

{ Version
  File:[22,310]TSTCWOTAS.PAS
  Author: Jim Bostwick 17-OCT-83
  History:

  last edit: 18-Oct-83

Testing P3UTIL module(s): CWOTAS

}
{[a+,b+,l-,k+,r+] Pasmat }
{$NOLIST}
%INCLUDE 'ex:[22,320]GENERAL3.TYP';
%INCLUDE 'EX:[22,320]CWOTAS.EXT';
{$LIST}

TYPE
  STR = PACKED ARRAY [0..50] OF CHAR;

VAR
  w,rad:word;
  s80:ch80;
  i,pos,p:integer;
  s:str;

BEGIN
  writeln('cwotas test.');
  write('enter a number (unsigned), radix, postition');
  readln(w,rad,pos);
  while rad > 0 do 
    BEGIN 
    s[0] := chr(0);
    for i := 1 to 50 do s[i] := '-';

    writeln('type 0, p=pos');
    p := pos;
    cwotas(w,s,p,rad);
    for i  := 1 to ord(s[0]) do write(s[i]);
    writeln('pos=',p);
    writeln;
    for i := 1 to 50 do s[i] := '-';
    s[0] := chr(0);

    writeln('type 0, p=-pos');
    p := -pos;
    cwotas(w,s,p,rad);
    for i  := 1 to ord(s[0]) do write(s[i]);
    writeln('pos=',p);
    writeln;
    for i := 1 to 50 do s[i] := '-';
    s[0] := chr(0);

    writeln('type 0, p=0');
    p := 0;
    cwotas(w,s,p,rad);
    for i  := 1 to ord(s[0]) do write(s[i]);
    writeln('pos=',p);
    writeln;

    writeln('type 1, p=pos');
    for i := 1 to 80 do s80[i] := '-';
    p := pos;
    cwotas(w,s80,p,rad);
    writeln(s80);
    writeln('pos=',p);
    writeln;
    for i := 1 to 80 do s80[i] := '-';

    writeln('type 1, p=-pos');
    p := -pos;
    cwotas(w,s80,p,rad);
    writeln(s80);
    writeln('pos=',p);
    writeln;
    for i := 1 to 80 do s80[i] := '-';

    writeln('type 1, p=0');
    p := 0;
    cwotas(w,s80,p,rad);
    writeln(s80);
    writeln('pos=',p);

    writeln;
    write('enter a number (unsigned), radix, position');
    readln(w,rad,pos)
    END;
  writeln('end of test.')
end.
