Results 1 to 7 of 7

Thread: xprint questions

  1. #1

    xprint questions

    Hi,
    I'm having a problem getting anything to print to my printer. I'm using the following code, which must be wrong. Any ideas would be appreciated.

    Printl (B,"/",a) /
    printl "Send to printer (y/n): "
    BEEP
    YN = inputbox$ (YN)

    IF YN = "Y" THEN xprint (B,"/",a)

    the printl (b,"/",a) works fine to the screen but the xprint doesn't. Error messages say it is looking for a ')' and finding something else, but I don't see anything else in my coding.

    Thanks
    Bob

  2. #2

    Re: xprint questions

    You are saying...
    xprint (B, "/", a)
    xprint (Parameter1, Parameter2, Parameter3)

    EG, 3 seporate parameters... but it expects only Parameter1 and then ")"
    ... not ", more, more)"

    Functions use "," to seporate parameters.
    EG, Distance(x,y) = Distance( Parameter1, Parameter2 )

    Use this...
    xprint (B & "/" & a)
    OR, if A and B are numbers
    xprint (STR$(B) & "/" & STR$(a))

    That is (String1 append String2 append String3)

    If A or B are numeric strings... be sure to use STR$(a) & "SomeText" & STR$(b)... or it will try to ADD them.

    EG, (a & b) is (a + b) as numbers not ("ab") as strings
    EG, (7 & 2) is (9) not (72) as numbers
    EG, ("7" & "2") is ("72") as strings

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,813
    Rep Power
    10

    Re: xprint questions

    Bob,

    you should find an example on using XPRINT commands set in \thinBasic\SampleScripts\XPRINT\ directory.

    ATTENTION: to use XPRINT commands you must first ATTACH a printer using XPRINT_Attach (keyword descritpion in help is wrong, I will fix it soon). With XPRINT_Attach you can choose the DEFAULT printer or open the printer dialog to choose a printer from list of installed printers. XPRINT_Attach let you also name your pinter job spool.

    Also remember to close your print out job using xprint_close when done

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Re: xprint questions

    Good catch...

    I was not aware of that method for printing... (Well, any method for printing.)

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,813
    Rep Power
    10

    Re: xprint questions

    Jason,

    1st: thanks a lot for user support you are giving here and in other threads. It is very very appreciated !
    2nd: you didn't know XPRINT? thinBasic is full of surprises

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6

    Re: xprint questions

    Quote Originally Posted by Eros Olmi
    Bob,

    you should find an example on using XPRINT commands set in \thinBasic\SampleScripts\XPRINT\ directory.

    ATTENTION: to use XPRINT commands you must first ATTACH a printer using XPRINT_Attach (keyword descritpion in help is wrong, I will fix it soon). With XPRINT_Attach you can choose the DEFAULT printer or open the printer dialog to choose a printer from list of installed printers. XPRINT_Attach let you also name your pinter job spool.

    Also remember to close your print out job using xprint_close when done

    Ciao
    Eros
    Once again, thanks for the help... I found the example on xprint and copied it and then put in a new file... It worked fine. I was able to print out the example info. As I studied the commands therein, I rapidly became confused as to how I could adapt it to my own use. But that is because I still have a lot to learn. So I'm working on it, and am beginning to feel like I have some understanding of the language... Not much, but some...

    Thanks again. Your info gave me some valuable insights for sure.

    Bob

  7. #7

    Re: xprint questions

    Quote Originally Posted by ISAWHIM
    You are saying...
    xprint (B, "/", a)
    xprint (Parameter1, Parameter2, Parameter3)

    EG, 3 seporate parameters... but it expects only Parameter1 and then ")"
    ... not ", more, more)"

    Functions use "," to seporate parameters.
    EG, Distance(x,y) = Distance( Parameter1, Parameter2 )

    Use this...
    xprint (B & "/" & a)
    OR, if A and B are numbers
    xprint (STR$(B) & "/" & STR$(a))

    That is (String1 append String2 append String3)

    If A or B are numeric strings... be sure to use STR$(a) & "SomeText" & STR$(b)... or it will try to ADD them.

    EG, (a & b) is (a + b) as numbers not ("ab") as strings
    EG, (7 & 2) is (9) not (72) as numbers
    EG, ("7" & "2") is ("72") as strings
    the variables were all strings, so I contantinated them and tried to print them, but I still have something to learn I guess, because I have yet to get the xprint to work, when I do the coding. I can get the sample program to work, but have yet to write my own, thereby showing that I really understand the techniques. I'll get there though. I am making progress in several areas that I will need to be able to use.

    Thanks again, for all the help.

    Bob

Similar Threads

  1. Xprint and Xprint_Font
    By steinie in forum thinAir General
    Replies: 2
    Last Post: 16-08-2011, 13:43

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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