   10INPUT LINE "ViewPS File: " File$
   20I% = OPENIN(File$)
   30Done = FALSE
   40 
   50startLine = TRUE
   60REPEAT
   70  C% = BGET#I%
   80  IF startLine THEN PROCNextLine ELSE PROCChar
   90UNTIL Done
  100 
  110END
  120DEFPROCNextLine
  130  IF EOF# I% THEN Done=TRUE:ENDPROC
  140  startLine = FALSE
  150  IF C%=&80 THEN PROCCommandLine:ENDPROC
  160  IF C%=&81 THEN PROCRuler:ENDPROC
  170  PROCChar
  180ENDPROC
  190 
  200DEFPROCChar
  210  IF C%=9 THEN PROCTab:ENDPROC
  220  IF C%=13 THEN startLine = TRUE: PROCVdu(13):ENDPROC
  230  IF C%=&1A THEN PROCSpace:ENDPROC
  240  IF C%=&1D THEN HighLight = BGET#I%:PROCHighLight:ENDPROC
  250  PROCVdu(C%)
  260ENDPROC
  270 
  280DEFPROCCommandLine
  290  Ch1 = BGET# I%:Ch2 = BGET# I%
  300REM Comment out the line below to remove embedded view commands
  310  PRINT "<ViewCommand ";CHR$(Ch1);CHR$(Ch2);">";
  320  REPEAT
  330    C% = BGET# I%
  340    PROCVdu(C%)
  350  UNTIL C%=13
  360  startLine =TRUE
  370ENDPROC
  380 
  390DEFPROCRuler
  400  Ch1 = BGET# I%:Ch2 = BGET# I%
  410REM Comment out the line below to remove the Ruler command
  420  PRINT "<ViewRuler ";CHR$(Ch1);CHR$(Ch2);">";
  430  REPEAT
  440    C% = BGET# I%
  450REM Comment out the line below to remove the Ruler itself
  460    PROCVdu(C%)
  470  UNTIL C%=13
  480  startLine = TRUE
  490ENDPROC
  500 
  510DEFPROCVdu(C)
  520  VDU C
  530  IF C=13 THEN VDU 10
  540ENDPROC
  550 
  560DEFPROCHighLight
  570REM Remove the line below to remove highlights
  580  PRINT"<Highlight ";CHR$(HighLight);">";
  590ENDPROC
  600 
  610DEFPROCSpace
  620  REM View uses these for justified spaces
  630ENDPROC
  640 
  650DEFPROCTab
  660REM Replace the line below with VDU 9 to leave tabs in the file
  670  PRINT "<Tab>";
  680ENDPROC
