Author |
Topic: printing to printer (Read 1932 times) |
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: printing to printer
« Reply #10 on: Jun 23rd, 2015, 07:00am » |
|
Quote:| Can anybody think of a sensible syntax for this? |
|
Named parameters, like in VBA? Not listed get default values. If position accept list, like list of pages, let it be string "1-5, 7, 9".
Or just one big string with named parameters list inside ("pages = 1-5, 7, 9 ; orientation = landscape; leftMargin = 1.5 cm")
|
| « Last Edit: Jun 23rd, 2015, 07:01am by tsh73 » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #11 on: Jun 23rd, 2015, 11:36am » |
|
on Jun 23rd, 2015, 07:00am, tsh73 wrote:Or just one big string with named parameters list inside ("pages = 1-5, 7, 9 ; orientation = landscape; leftMargin = 1.5 cm") |
|
So, for consistency with other LB printer settings, you are proposing something like:
Code:PrinterSetup$ = "orientation = landscape; leftMargin = 1.5 cm" Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: printing to printer
« Reply #12 on: Jun 23rd, 2015, 12:16pm » |
|
well, kind of. May be - for consistency with LB GUI commands - get rid of "=", so it becames Code:PrinterSetup$ = "orientation landscape; leftMargin 1.5 cm" ?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #13 on: Jun 23rd, 2015, 3:57pm » |
|
on Jun 23rd, 2015, 12:16pm, tsh73 wrote:| May be - for consistency with LB GUI commands |
|
I think I'd be inclined to simplify even further:
Code: PrinterName$ = "DoPDF v7"
PrinterFont$ = "Arial 12 bold"
PrinterColor$ = "blue"
PrinterSetup$ = "landscape 15 10 10 10" I should add that at present I have no plans for a new release of LBB but I'll make a mental note of the possibility of such additions should the atmosphere change.
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: printing to printer
« Reply #14 on: Jun 23rd, 2015, 4:18pm » |
|
Code:
PrinterName$ = "DoPDF v7"
PrinterFont$ = "Arial 12 bold"
PrinterColor$ = "blue"
PrinterSetup$ = "landscape 15 10 10 10"
Doesn't it look like too many reserved words?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #15 on: Jun 23rd, 2015, 7:36pm » |
|
on Jun 23rd, 2015, 4:18pm, tsh73 wrote:| Doesn't it look like too many reserved words? |
|
What problems do you see, and what is the alternative? Combining PrinterColor$ and PrinterSetup$ in a single new command seems to me illogical and inconsistent with the rest of LB, and the compatibility issues arising from having both are minimal.
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: printing to printer
« Reply #16 on: Jun 23rd, 2015, 8:03pm » |
|
I see single entity - printer - and several keywords associated with it PrinterName$ PrinterFont$ PrinterColor$ PrinterSetup$
Suppose you will want to add two side printing or DPI setting or paper size - will you add still another word?
I think pack it all in single string is better, much like OPEN COM from LBB helpfile: Code:open "COMn: [baud=b] [parity=p] [data=d] [stop=s]
[to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
[dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]"
|
| « Last Edit: Jun 23rd, 2015, 8:03pm by tsh73 » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #17 on: Jun 24th, 2015, 04:10am » |
|
on Jun 23rd, 2015, 8:03pm, tsh73 wrote:| Suppose you will want to add two side printing or DPI setting or paper size - will you add still another word? |
|
Of course not - those are setup features which would be set using PrinterSetup$.
Quote:| I think pack it all in single string is better |
|
Mixing things which can only be changed before you print (e.g. page layout) with things that can be changed within a page (e.g. font and colour) is wrong in my opinion. But since we disagree to such a great extent it is probably better if I forget this feature altogether.
Richard.
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: printing to printer
« Reply #18 on: Jun 24th, 2015, 06:59am » |
|
Quote:| Mixing things which can only be changed before you print (e.g. page layout) with things that can be changed within a page (e.g. font and colour) is wrong in my opinion. |
|
Ok I admit I never thought of this from this point. You are right. Quote:But since we disagree to such a great extent it is probably better if I forget this feature altogether. |
|
No-no-no. You are the boss. You asked for suggestions - here we are - but decision is yours. And feature implemented in different way is much better then feature non-inplemented, IMHO.
|
|
Logged
|
|
|
|
hammerjit
New Member
member is offline


Posts: 26
|
 |
Re: printing to printer
« Reply #19 on: Jun 24th, 2015, 09:09am » |
|
Richard....your suggestion is good, please do consider if there is future enhancement. 
btw...another question on this printing....if the output goes more than 2 pages, is there a way for us to put a header for each page? and also page number?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #20 on: Jun 24th, 2015, 10:50am » |
|
on Jun 24th, 2015, 09:09am, hammerjit wrote:| if the output goes more than 2 pages, is there a way for us to put a header for each page? and also page number? |
|
I think I have a program which does that, but unfortunately it's on my PC at home and I don't have access to it where I am. Remind me in a couple of weeks.
Richard.
|
|
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Reminder to Richard...
« Reply #21 on: Jul 11th, 2015, 10:35pm » |
|
>if the output goes more than 2 pages, is there a way for us to put a header for each page? and also page number?
I think I have a program which does that, but unfortunately it's on my PC at home and I don't have access to it where I am. Remind me in a couple of weeks.
Richard.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: printing to printer
« Reply #22 on: Jul 12th, 2015, 10:25am » |
|
on Jun 24th, 2015, 10:50am, Richard Russell wrote:| I think I have a program which does that |
|
Here is the program. It's intended as a proof-of-principle, in practice you would probably want to put the printing code in a SUB so it can be called from multiple places:
Code: PrinterName$ = "DoPDF v7"
pv = 99999
page = 1
for i = 1 to 200
oldpv = pv
!pv = @vdu%!-8
if pv < oldpv then
lprint "THIS IS THE HEADER FOR PAGE "; page
lprint
page = page + 1
end if
lprint "This is line "; i; " of text sent to the printer"
next
dump Note that this can't work if you are relying on the 'word wrap' capability of LPRINT (unless you output each word individually), because if it wraps from one page to the next it's impossible to print the header part way through the output string.
Richard.
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: printing to printer
« Reply #23 on: Jul 12th, 2015, 12:35pm » |
|
Thank you Richard, It is a kind of you. Thank you very much.
|
|
Logged
|
|
|
|
|