View Full Version : xprint questions
spiritsoul
19-11-2008, 02:12
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
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
ErosOlmi
19-11-2008, 09:04
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
Good catch...
I was not aware of that method for printing... (Well, any method for printing.)
ErosOlmi
19-11-2008, 11:05
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
spiritsoul
19-11-2008, 14:10
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
spiritsoul
19-11-2008, 14:15
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