Announcement

Collapse
No announcement yet.

Banner program?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Banner program?

    Hi

    Does anyone know of a banner program that will print out on 8-1/2"
    high continuous paper? Preferable capable of using the various
    computer fonts and/or multiple lines?

    Fred K

    ------------------

  • #2
    .

    [This message has been edited by Karl Lessmann (edited November 27, 2003).]

    Comment


    • #3
      That link doesn't seem to be working, Karl.

      Banner programs used to be a dime a dozen. Kind of looks like dimes
      have gone out of style, doesn't it? I'll see if I can put something
      simple together.

      DOS doesn't have font support. There's a font library or so in the
      PB/DOS Downloads here, though it's intended for video displays, not
      printers. Might be possible to get there from here, I dunno... at
      worst, I guess, you could read the character pixels off the display
      and translate the result to printed output.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Ok. This is rude and crude, but it should be good for a start. First,
        a wee program to grab the simple 8x8 character definitions from your
        display adapter. We switch to "high res" CGA mode, display each character
        one at a time, capture the results, and dump it to a file.
        Code:
            SCREEN 2
            DEFINT a-z
            open "8x8font.dat" for binary as #1
            for z = 0 to 255
                cls
                print chr$(z);
                FOR x = 0 TO 7
                    FOR y = 0 TO 7
                        w = w * 2 OR point(x, y)
                    NEXT
                    put$ #1, chr$(w)
                    w = 0
                NEXT
            next
            close #1
        Now, we've got a font file that tells us what the characters look like.
        Ask for a string to print, and print it out using a magnified version of
        the font data.
        Code:
            defint a-z
            dim font(0 to 255) as string * 8
        
            open "8x8font.dat" for binary as #1
            for x = 0 to 255
                get$ #1, 8, font(x)
            next
            close #1
        
            cls
            line input "Text? "; s$
        
            for x = 1 to len(s$)
                for y = 1 to 8
                    w = 1
                    for z = 1 to 8
                        if (asc(font(asc(s$, x)), y) and w) then
                            o$ = o$ + string$(9, "#")
                        else
                            o$ = o$ + space$(9)
                        end if
                        w = w * 2
                    next
                    for z = 1 to 4
                        lprint o$
                    next
                    o$ = ""
                next
            next
        Not too opaque, I hope. Public domain, in any event-- do what you want
        with it.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          "Banner programs used to be a dime a dozen.
          Kind of looks like dimes have gone out of
          style, doesn't it?"

          Tom:
          Sure does

          The link above did work?
          -Karl

          [This message has been edited by Karl Lessmann (edited November 28, 2003).]

          Comment


          • #6
            Tom

            Thanks for the program, however, there appears to be some problem
            in the following statement: "if (asc(font(asc(s$, x)), y) then".
            I get an error message 414, indicating that a closing bracket
            should be after s$. Please indicate where the problem is.

            Fred K

            ------------------

            Comment


            • #7
              I guess you're not using PB/DOS 3.5 ...?

              For older compilers, you can replace ASC(s$, n%) with ASC(MID$(s$, n%, 1))

              Or, maybe it's a good day to upgrade your compiler:

              http://www.powerbasic.com/products/pbdos/

              ------------------
              Tom Hanlin
              PowerBASIC Staff

              Comment


              • #8
                Hal

                I'm still using PowerBASIC version 3.0 so it appears that I'm due
                an upgrade, but being on a pension I have limited funds. It appears
                that that version 3.0 only supports ASC(s$) with no extensions.
                The problem line wants me to put all the closing brackets after
                the 1 followed by a THEN, and ignore "y and w".
                Any suggestions?

                Fred K


                ------------------

                Comment


                • #9
                  For older compilers, you can replace ASC(s$, n%) with ASC(MID$(s$, n%, 1))

                  ------------------
                  Tom Hanlin
                  PowerBASIC Staff

                  Comment


                  • #10
                    Hal

                    I was able to get the problem statement coded however I only get
                    blue lines running down the screen. No output to the printer. I'm
                    using DOSPRINT to print out. As suggestions?

                    Fred K

                    ------------------

                    Comment


                    • #11
                      First I assume that you adapted the LPRINT statements in Tom's code, so that the print data is actually being was written to a disk file? It would also be a good idea to make sure the file is closed before launching DOSPRINT.

                      Assuming the file is created correctly, and DOSPRINT is being launched correctly, you'll likely need to enable DOSPRINT's auto-formfeed mode (/FF) if you want the print job to extend beyond the first page (because Windows-based printing is page-centric).

                      If you still haven't got it runing at this stage, I'dd suggest that you enable the Log File option (/LF) and then examine the log file for error values, etc.

                      I hope this helps!

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

                      Comment


                      • #12
                        Lance

                        I had done all you suggested but in the preview window there was
                        nothing and the prnt.log reported nothing except that I had aborted
                        the program.

                        I coverted Tom's statement:
                        if (asc(font(s$, x)), y) and w) then
                        to:
                        a = ASC(MID$(s$, x, 1))
                        IF ASC(MID$(font(a), y, 1)) AND w THEN

                        Do you see any problem?

                        Fred K

                        ------------------

                        Comment


                        • #13
                          I coverted Tom's statement:
                          Code:
                          if (asc(font(s$, x)), y) and w) then
                          to:
                          Code:
                          a = ASC(MID$(s$, x, 1))
                          IF ASC(MID$(font(a), y, 1)) AND w THEN
                          Do you see any problem?
                          In the "from" the ASC value is bitswise AND'd with W before the condition is evaluated.

                          In the "to" the "AND w" is treated as a second condition to the IF.
                          You need to add another set of parens...
                          Code:
                          IF (ASC(MID$(font(a), y, 1)) AND w) THEN
                          This is a byproduct of "short-circuit" evaluation, which is better performance when it really is two conditions rather than a 'bitswise AND' you are testing.

                          MCM

                          Michael Mattias
                          Tal Systems Inc. (retired)
                          Racine WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                          • #14
                            Michael

                            When I add the additional set of brackets that you indicated I
                            just get the blue lines and the computer freezes up and I have to
                            shut it down.

                            Fred K


                            ------------------

                            Comment


                            • #15
                              Just in case anybody is still actually
                              interested:

                              Link to PrintPartner has been fixed:
                              http://www.wwmen.com/acropolis/printp35.zip

                              Author warns DOS stuff no longer supported.
                              -Karl

                              ------------------

                              Comment


                              • #16
                                BTW, Fred's program (derived from the code above) has been sorted out too.

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

                                Comment

                                Working...
                                X