Announcement

Collapse
No announcement yet.

Xprint Copies problem

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

  • Xprint Copies problem

    Hi from austria,

    i have now tried for hours to use copies with my printer driver; but it was not possible to use ths feature. Here my code:

    DIM Co&

    XPRINT ATTACH DEFAULT
    XPRINT SET COPIES 4
    XPRINT GET COPIES TO Co&

    XPRINT CLOSE

    When i debug this code, i always get 0 in Co&; i tried many different printer drivers, which are able to produce copies in other languages.
    Any ideas?

    Thanks from austria!

  • #2
    I changed the '4' to '2' just so I wouldn't waste too much paper, and the following works. It does not work if the line "XPRINT stuff" is commented out.
    Code:
    #COMPILE EXE
    #DIM ALL
    
    FUNCTION PBMAIN () AS LONG
      DIM Co&
      LOCAL stuff AS STRING
      stuff= "Well what do you know?"
      XPRINT ATTACH DEFAULT
      XPRINT SET COPIES 2
      XPRINT GET COPIES TO Co&
      XPRINT stuff
      XPRINT CLOSE
        
    
    END FUNCTION
    XPRINT SET COPIES and XPRINT GET COPIES TO Co& will not do anything until it has something to print.
    Last edited by Rodney Hicks; 21 May 2009, 05:54 PM.
    Rod
    In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

    Comment


    • #3
      I also tried the following, because Co& still equaled 0 even though it printed the correct number of copies. And it still equals 0 in this case as well, but does indeed print four copies.
      Code:
      #COMPILE EXE
      #DIM ALL
      FUNCTION PBMAIN () AS LONG
        LOCAL Co,du AS LONG
        LOCAL stuff AS STRING
        du=4
        stuff= "Well what do you know?"
        XPRINT ATTACH DEFAULT
        XPRINT SET COPIES du
        XPRINT GET COPIES TO Co
        XPRINT stuff;Co;du
        XPRINT CLOSE
        PRINT Co;du
        WAITKEY$
      
      END FUNCTION
      Perhaps PB support could explain this if you sent it in.
      Last edited by Rodney Hicks; 21 May 2009, 06:02 PM.
      Rod
      In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

      Comment


      • #4
        Thanks for your help; how can i check, if the customers printer driver supports copies?
        If there is no possibility i have to make the copies per code and this command makes no sense.
        Greetings from an austrian wine- and softwaremaker!
        Reinhard Böck

        Comment


        • #5
          Change

          Code:
          XPRINT ATTACH DEFAULT
          to

          Code:
          XPRINT ATTACH CHOOSE
          and see the copy options in Windows print dialog, like below

          Code:
          #COMPILE EXE
          #DIM ALL
          
          FUNCTION PBMAIN () AS LONG
          
              LOCAL Co, Cc AS LONG
          
              ERRCLEAR
              Co = 1000
              XPRINT ATTACH CHOOSE'DEFAULT
              IF ERR = 0 AND LEN(XPRINT$) > 0 THEN
                  XPRINT SET COPIES Co
                  IF ERR = 5 THEN
                      ? "Multiple copies (or count requested) are not supported by this printer driver!",,"Xprint Set Error"
                      XPRINT CLOSE
                      EXIT FUNCTION
                  END IF
                  XPRINT GET COPIES TO Cc
                  IF Cc = Co THEN
                      ? "Done! Copy count set to" & STR$(Cc),,"Good Driver for " & XPRINT$
                  ELSE
                      ? "Count requested are not supported by this printer driver!",,"Xprint Get Error"
                  END IF
              END IF
          
              XPRINT CLOSE
          
          END FUNCTION
          Edited: Try using the most generic printer driver
          Last edited by Arthur Gomide; 22 May 2009, 01:48 PM.
          "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

          Comment


          • #6
            Thanks for your help,

            i have installed more than 15 different types of printer, some virtual etc.
            I get different results with error 5, but all drivers sets 0 to Cc after using
            XPRINT GET COPIES TO Cc.
            In the help file you will find "The default value is one (1)", but i always get 0!
            With other tools (Vb6 and Componentone VsPrint) i am able to set and read back a value for Copies from the printer driver.
            Did you find a printer driver, which reported another value then 0 in Cc?

            Greetings
            Reinhard Böck

            Comment


            • #7
              Like you Reinhard, I could not get any other value other than 0 with XPRINT GET COPIES TO somevariable. I think the best bet would be to send a request for clarification in to support at:[email protected]
              If an answer is forthcoming, it would be nice if it were posted here to assist others should they encounter this issue in the future.
              Rod
              In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

              Comment


              • #8
                first answer from support

                This appears to be an issue in the compiler. R&D is looking into this now, if this is found to be an issue in the compiler an update will be available in the near future.

                Comment


                • #9
                  Thanks Reinhard!
                  Rod
                  In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                  Comment

                  Working...
                  X