No announcement yet.

Printing text files

  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing text files

    Is there a way to print a form feed
    without advancing the print position
    so the next page prints at the current position?
    PRINT #1, CHR$(12);
    CLOSE #1
    The code above form feeds, but the print head 
    will be 1 position to the right.
    Can't use PRINT #1, CHR$(12) because it
    issues a carriage return/line feed and if
    the file printing is at end of file some dot-matrix
    printers advance an extra page because of the 
    trailing chr$(13) and char$(10).
    Do I have to PRINT #1, CHR(8)+Chr$(12);
    each time a CHR$(12) is found in a file to print
    that does not have a carriage return/line feed after
    the form feed and characters follow the form feed?
    I wrote a print manager that prints text files
    and files can have embedded form feeds that sometimes
    need to surpress advancing the print head to line-up
    on the next page.
    Should I be using another print mode?


    [This message has been edited by Mike Doty (edited September 26, 2000).]

  • #2
    Often the behavior "Form feed implies CRLF" is defined by the PRINTER, not the software.

    You may need to count characters (or use LPOS) to track where you are on the line and advance there after issuing FF.

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]


    • #3
      Another possibility would be to use

      print #1;chr$(12);
      instead of
      print #1,chr$(12);

      I have discovered that somewhere in the printing process, the
      comma is sometimes interpretered as a CR/LF. Using the
      semi-colon suppresses this.

      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.


      • #4
        Mel, I have no idea where/how you came up with that one... Can you give us a specific example or code that can prove this statement?

        Mike, the best answer here is from Mr Mattias...

        How are *you* counting your character positions? Remember that LPOS cannot decypher printer control codes from printable characters, so you have to allow for this in any code that needs to track the current "physical" position (rather than the "logical" position as reported by LPOS, etc).

        The same problem can occur when using TAB() after sending control code(s).

        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        mailto:[email protected]


        • #5
          Now using:
          CRFF$ = CHR$(13) + CHR$(12)
          PRINT #1, CRFF$;
          Works great.  Thanks all.