PROGRAM TSTPUTSTR;

{ Testing the PUTSTR library procedure.

FILE: [22,311]PUTSTRT.PAS
History: J.M.B. 2-Feb-82 created
  	JMB 1-Nov-83 modified for P3UTIL
}



%INCLUDE 'EX:[22,320]GENERAL3.TYP';
%INCLUDE 'EX:[22,320]VT100.TYP';
%INCLUDE 'EX:[22,320]PUTSTR.EXT';
{$LIST}

VAR
    INSTR:CH20; {READ-IN STRING}
    ATTSET:CRT_ATTRIBUTE_SET;
    LINE,COLUMN:INTEGER;
    SAVE:BOOLEAN;
    ERASE:BOOLEAN;
    ISAVE,IERASE:INTEGER;
    attribute:crt_attribute;


BEGIN
rewrite(output,'TI:/ftn' );

INSTR:='HI! I am PUTSTRTS   ';
PUTSTR(-2,1,[REVERSE,double_wide],INSTR);
attset := [standard];
attribute := bold;
PUTSTR(20,1,[Standard],' ENTER LINE,COLUMN,ERASE(1/0),SAVE(1/0),STRING:');
While Not(Eof) DO
  BEGIN 
  READ(LINE,COLUMN,IERASE,ISAVE); READLN(INSTR);
  ERASE:=IERASE=1;
  IF ERASE THEN LINE:=-1*LINE;
  if isave = 1 then attset := attset + [save_cursor] 
    else attset := attset - [save_cursor];
  PUTSTR(LINE,COLUMN,ATTSET,INSTR);
  if standard in attset then attset := attset - [standard];
  attribute := succ(attribute);
  if attribute = save_cursor then attribute := standard;
  attset := attset + [attribute];
  PUTSTR(0,-1,[Standard], ' ENTER LINE,COLUMN,ERASE(1/0),SAVE(1/0),STRING:')
END;
Putstr(-1,1,[Standard],'End of test. ')
END.
