program Picture;

type
  StringMax = string [255];
  String2   = string [2];

const
(* CRT Variables                                  *)
  CRTBeepStr    : string2 = #07;
  CsrLeftStr    : string2 = #08;
  CsrRightStr   : string2 = #12;

var
  InString: StringMax;
  InPic   : StringMax;
  Choice  : char;

{$I B:CRT.Prc      }

{$I B:SayPic.Fnc   }

{$I B:GetPic.Fnc   }

begin
  ClrScr;
  repeat
    writeln;
    writeln ('1 = SayPic');
    writeln ('2 = GetPic');
    writeln ('9 = Exit Program');
    writeln;
    write ('Enter your choice: ');
    Choice := GetPic ('0', '#');
    writeln;
    case Choice of
      '1':
       begin
        writeln;
        write ('Enter Picture:  ');
        readln (InPic);
        writeln;
        write ('Enter String:   ');
        readln (InString);
        writeln;
        write ('Output String:  ');
        writeln (SayPic (InString, InPic));
       end;
      '2':
       begin
        writeln;
        write ('Enter Picture:  ');
        readln (InPic);
        writeln;
        write ('Enter String:   ');
        readln (InString);
        InString := SayPic (InString, InPic);
        writeln;
        write ('GetPic:         ');
        write (InString);
        CsrLeft (length (InPic));
        InString := GetPic (InString, InPic);
        writeln;
        writeln;
        write ('Output String:  ');
        writeln (InString);
       end;
    end;
  until Choice = '9';
end.
