Pascal: Intrinsic unit for Silentype procedures (3 of 3)

Function Form;
CONST Formlength= -12531;
Begin
Form:=ByteValue(Formlength)
End;

Procedure SetSpace;
CONST INCR= -12530;
Begin
If Length<1 Then Length:=1;
IF Length>252 Then Length:=252;
SetByteValue(INCR,Length)
End;

Function Space;
CONST INCR= -12530;
Begin
Space:=ByteValue(INCR)
End;

Function LeftMargin;
CONST LMAR= -12527;
Begin
LeftMargin:=ByteValue(LMAR)
End;

Function RightMargin;
CONST RMAR= -12526;
Begin
RightMargin:=ByteValue(RMAR)
End;

Procedure SetLeftMargin;
CONST LMAR= -12527;
Begin
If Position>=RightMargin Then
Position:=RightMargin-1;
If Position<0 Then Position:=0;
SetByteValue(LMAR,Position)
End;

Procedure SetRightMargin;
CONST RMAR= -12526;
Begin
If Position<=LeftMargin Then
Position:=LeftMargin+1;
If Position>83 Then Position:=83;
SetByteValue(RMAR,Position)
End;

Procedure PrintBuffer;
CONST CF= 6; (* ASCII for CONTROL-F *)
Begin
Send(CHR(CF))
End;

Procedure ClearBuffer;
CONST PrintUnit= 6;
Begin
UnitClear(PrintUnit)
End;

Procedure FormFeed;
CONST FF= 12; (* ASCII for form-feed *)
Begin
Send(CHR(FF))
End;

Procedure PrintPic;
CONST CQ= 17; (* ASCII for CONTROL-Q *)
Var BiDirect: boolean;
Begin
If UniDirect =True Then BiDirect:=False
Else BiDirect:=True;
If BiDirect Then SetUniDirect;
Send(CHR(CQ));
If BiDirect Then SetBiDirect
End;

Procedure ColdStart;
CONST MinByte= 0;
Default= -12506;
Begin
SetByteValue(Default,MinByte)
End;

Procedure WarmStart;
Begin
SetBiDirect;
SetPositive;
SetPage(1);
SetDark(5);
SetForm(40);
SetSpace(2);
SetLeftMargin(2);
SetRightMargin(81);
End;

Begin (* Initialization Section *)
ColdStart;
End.

Published Date: Feb 18, 2012