Wrong printer picked up
Wrong printer picked up
I'm currently using FWH27, but it's a long time problem even with previous FW(H) versions.
If I have 2 printers with similar long names, for example:
HP Officejet 6200 series fax
HP Officejet 6200 series
PRINT oPrn NAME cName TO "HP Officejet 6200 series" - may pick up the fax one.
The FROM USER clause always works well.
I know that as a workaround you can rename the first one simply as HPFax, but I was wandering if this could be solved definitely.
Thank you,
Davide
If I have 2 printers with similar long names, for example:
HP Officejet 6200 series fax
HP Officejet 6200 series
PRINT oPrn NAME cName TO "HP Officejet 6200 series" - may pick up the fax one.
The FROM USER clause always works well.
I know that as a workaround you can rename the first one simply as HPFax, but I was wandering if this could be solved definitely.
Thank you,
Davide
Re: Wrong printer picked up - SOLVED
Solved: In Printer.prg - Function PrintBegin()Davide wrote:If I have 2 printers with similar long names, for example:
HP Officejet 6200 series fax
HP Officejet 6200 series
PRINT oPrn NAME cName TO "HP Officejet 6200 series" - may pick up the fax one.
Code: Select all
nScan := Ascan(aPrn, {|v| Upper(xModel)$Upper(v) })
Code: Select all
nScan := Ascan(aPrn, {|v| Upper(xModel)==Upper(v) })
Hi,
Davide
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Uhm, that way if you have more than a printer containing the word "fax" you don't know which one will be picked up.Antonio Linares wrote:PRINT oPrn NAME cName TO "fax"
In addition, even using the TO <entire_printer_name> you may experiencing problems, like in the example I've posted above. More and more all-in-one printers nowadays are installing printer drivers named that way.
Regards,
Davide
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Antonio,
I would vote for fixing the problem even if it breaks some existing applications. You could put a warning in the What's New file. However, it is not me that developers might be upset with if existing apps are broken, so I understand why you would not want to do that.
May I offer a compromise. Add an lExactName var we can set to force it to use exact naming, and default it to false. That way no existing apps will be broken.
The alternative would be to set it to true. Existing apps that are affected would then have to change it to false but it would be a simple fix.
James
I would vote for fixing the problem even if it breaks some existing applications. You could put a warning in the What's New file. However, it is not me that developers might be upset with if existing apps are broken, so I understand why you would not want to do that.
May I offer a compromise. Add an lExactName var we can set to force it to use exact naming, and default it to false. That way no existing apps will be broken.
The alternative would be to set it to true. Existing apps that are affected would then have to change it to false but it would be a simple fix.
James
Antonio, Richard, James,
This way the <exact_printer_name> should be selected because it's found before <exact_printer_name>+" fax", solving both needs.
what about:Antonio Linares wrote:I am afraid that we may break existing applications if we change it in FWH
Code: Select all
aPrn:=ASORT(aPrn)
nScan := Ascan(aPrn, {|v| Upper(xModel)$Upper(v) })
even better:
Hi,
Davide
Code: Select all
If ( nScan := Ascan(aPrn, {|v| Upper(xModel)==Upper(v) }) ) = 0
nScan := Ascan(aPrn, {|v| Upper(xModel)$Upper(v) })
Endif
Davide
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: