Rem This screen dump subroutine should be MERGEd into your program to produce
Rem  a screen dump when called (GOSUB dump).
Rem Make sure your program has an 'END' statement and doesn't just drop
Rem  through into this:
Procedure Dump
  Dim Scr(639)
  Dim P(7)
  Rem Set graphics line width
  Lprint Chr$(27)+"A"+Chr$(7);
  Rem Fill array P with powers of two
  For B=0 To 7
    P(B)=2^(7-B)
  Next B
  Rem Now take eight dot lines at a time,
  For Y=0 To 50
    Rem Clear Scr array (which will contain horizontal bit information) to zero.
    For X=0 To 639
      Scr(X)=0
    Next X
    Rem Now go over the width of the screen
    For X=0 To 639
      Rem looking at 640 vertical sets of eight dots.
      For B=0 To 7
        Rem If the dot has been set, then
        Rem  set the corresponding bit in Scr(x)
        If Point(X,Y*8+B)=1 Then
          Scr(X)=Scr(X) Or P(B)
        Endif
      Next B
    Next X
    Rem Tell printer to expect 640 graphic characters
    Lprint Chr$(27)+"L"+Chr$(128)+Chr$(2);
    Rem Now send them to printer
    For X=0 To 639
      Lprint Chr$(Scr(X));
    Next X
    Rem Print a line feed...
    Lprint Chr$(13)
    Rem go back for another eight dot lines
  Next Y
  Rem Screen dump completed - back to your program.
Return
