PCLOldOne := PCLChrOne; PCLOldTwo := PCLChrTwo; Buffer.InsertS(ParmVal); PCLOldParm := PCLChrParm; end;); if PCLState in [1,3,4,5] and Data[0]=#27 then PCLState if PCLState in [2,6,7] then begin ParmVal:="; if PCLState=2 then begin Istarting a command, seen escape) PCLChrOne := Buffer.GetChar; if IsCharUpper(PCLChrOne) then PCLState := 3; (EOC on first character = 2 Char command) else begin PCLState := 6; Ifirst term or 3 char command waiting} PCLChrOne := UpCase(PCLChrOne); ParmVal := Buffer.GetNum; {only see a number on 3char command) PCLChrTwo := Duffer.GetChar; if IsCharUpper(PCLChrTwo) then begin PCLChrParm := PCLChrTwo; PCLState := 4 if Length(ParmVal)>O then begin PCLChrParm := UpCase(PCLChrTwo); end; end; end; if PCLState in [6,73 and Length(ParmVal) = O then begin (term waiting) ParmVal := Buffer.GetNum; PCLChrParm := Buffer.GetChar; if IsCharUpper(PCLChrParm) then PCLState := PCLState-2; {last term. 6 becomes 4, 7 becomes 5) else PCLChrParm := UpCase(PCLChrParm); end; if PCLState in [4,6,7] and PCLChrParm='W' then begin Len := ValS(ParmVal); Len := MinP(Len,EndPtr-BufPtr); Move(Binary, BufPtr[O], Len); Ilotta room for crashing here!) BufPtr := BufPtr+Len; PCLState := Min(PCLState +1,7); 14 becomes 5, 6 becomes 7~ end; Buffer.Delete; PCLGet := True; end; else begin IWe have ended a previous command and are being ask to load a PCL command but the escape character is not at the begining of the buffer indicating that something is wrong} PCLGet := False; end; end; PCLOut ISlnle IIDeucripfian II I1NotinPCL 12. 1/ Stored an Escape 13 1/ Stored a 2 char command 14. Ij Stored last term of command 15 I1Stared last term with binary data 16. I1Stored a term, waiting for another term 17. I1Slored a term with binary data, waiting for another term procedure Buffer.PCLPut; var Ptr: PChar; begin Ptr := BufPtr; case PCLState of 1..3: begin Previously: 1 Not in PCL or 2 Seen an Escape or 3 Loaded a 2 char command With any of these, this is the first term of the new command if PCLState o 2 then Buffer.InsertS(#27); {not already passed the escape} Buffer.InsertS(PCLChrOne)); if IsCharLower(PCLChrOne) then begin Buffer.InsertS(LowerCase(PCLChrTwo)); Buffer.InsertS(ParmVal); Buffer.StuffS(UpCase(PCLChrParm)); end; end; 4..5: begin or 4 Loaded last term of command or 5 Loaded last term with binary data end; 6..7: begin Previously: 6 Loaded a term, another term waiting or 7 Loaded a term with binary data, another term waiting end; end;