Results 1 to 9 of 9
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    QuickBASIC and Form Feed (I think 4, maybe 3)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    Sorry I have been away for a while, and now I can come up for some air and send a request not to shoot me first then read this second, but to the opposite.

    OK my Boss is so proud of what he has done some 20 years ago, that there is no way I am going to convince him to let me upgrade the systems he has put in place.

    In a routine task of looking at internal processes, we discovered that my Boss has written some QuickBASIC code that handles some sensitive issues that is still working on MS-DOS and Dot matrix printers. To be honest with you, I am quite impressed by what he did, some 20 years ago...

    BUT!!! <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15> he is not going to let me touch it and move it into a VB or VBA version <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15> and I tried. There is a problem, and we need to fix the program so that it can do a form feed on a dot matrix printer.

    Now I know that this is a huge deal, and maybe manually one will still get it wrong, but I was hoping to even allow the printer to reset say if someone counts the sprockets and then the code will rewind or forward by what ever it needs to print.

    I printed a report, and it came out on half the page, because I did not know I had to reset the page to a certain position. This is where the problem came up, and my Boss is adamant on keeping his legacy alive... <img src=/S/duck.gif border=0 alt=duck width=23 height=23> <img src=/S/drop.gif border=0 alt=drop width=23 height=23>

    So even if the answer is "can't do it" please let me know, maybe the preponderance of evidence will help him wise up.

    Cordially

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    As I recall, you had to send a form feed to the printer when a page ended in the middle like that. The form feed moved the page to the next top of page and everything was fine. Unfortunately, dot matrix printers were a little flaky when it came to handling exact page lengths and over multiple pages (they usually counted the lines advances, which was inexact, to say the least), the "top" could creep down quite a ways. You will have to send an ESC code to the printer, which means you need the manual for that printer so you can tell what code to send. They didn't all use the same ESC codes for the same thing because each printer had its own set of proprietary drivers. Even different models from the same manufacturer used different drivers, so best of luck in your search for answers.
    Charlotte

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    Just following on from Charlotte's reply, you can discover the formfeed ASCII character code for your particular printer by outputting a table generated from a loop with, say, i ranging from 0 to 255. Just keep outputting lines like:
    i & " " & chr(i) & crlf
    to the printer. It will be obvious which ASCII code fires a formfeed. The syntax will need to be correct for QuickBasic, of course.

    Alan

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    I think that all printers use ASCII 12 (Control L) for the form feed character. I think Charlotte is talking about an escape sequence for creating the small paper movement needed to re-align a printer that has lots its memory of where the top of the page is.

    StuartR

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    It's been a long time since I used a dot matrix printer, and I'm rusty. <img src=/S/blush.gif border=0 alt=blush width=15 height=15> I just recall the problem described as being fairly common in DOS applications, and you're correct, I was thinking of the Top of Page (or whatever it was called) sequence. As for consistency in ASCII codes, you must have used different printers than I, Stuart. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> I don't recall much consistency at all in dot matrix printers, and I *always* kept the page marked with the printer codes and ESC sequences for each printer.
    Charlotte

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    I thought so too Stuart. Until I tried it in DOS edit.com. I find that my new printer doesn't support printing from DOS anymore <img src=/S/sad.gif border=0 alt=sad width=15 height=15> so I used Notepad to print the test doc, created in DOS Edit, containing a Alt+012 character. It wasn't picked up as a formfeed and I know it used to work as a formfeed when I could print directly from Edit.com.

    Alan

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    FormFeed always has been code 12.

    However, that works only when the printer is being directly dsent characters, if it ids going thru some intermediate app/somethhing, the codes moght be changed prior to reaching the printer.

    Actually, with a "boss" like that, it is time for a coup d'etat.
    Get rid of, or educate, the turkey.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)

    I might be able to help, but your boss will have to open his/her checkbook.
    If interested have the boss send me email.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QuickBASIC and Form Feed (I think 4, maybe 3)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •