Board index » off-topic » Printing to USB port

Printing to USB port


2003-11-14 12:07:28 AM
off-topic15
Bought a WinXP machine and a new printer. The printer connects to a
USB port only and unless I copy the *.PAS file to a *.TXT file, it
will not print. Does anyone know how to somehow connect LTP1 and USB?
Tried "Copy filename.ext PRN", and that doesn't work.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
 

Re:Printing to USB port

On Thu, 13 Nov 2003 11:07:28 -0500, in
< XXXX@XXXXX.COM >, BillV
< XXXX@XXXXX.COM >wrote:
Quote
Bought a WinXP machine and a new printer. The printer connects to a
USB port only and unless I copy the *.PAS file to a *.TXT file, it
will not print. Does anyone know how to somehow connect LTP1 and USB?
Tried "Copy filename.ext PRN", and that doesn't work.
The following code copied from an earlier posting by Femme
Verbeek with my own comments added:
=======
Quote
If the USB printer is the default printer, the trick is to write the
info to a file first and next to use a windows program to do the
printing for you:
e.g.

uses Dos;

{$M 8192,0,0}

procedure PrintFile (Filename : string);
begin
SwapVectors;
Exec(getenv('COMSPEC'),'/C notePAD.exe /p '+Filename);{}
SwapVectors;
end;
will do the trick.
The above has worked for me for some time. Be sure to preset the
font used by Notepad (and WordPad below) to one that is properly
spaced for your style of Pascal output. If you want formatted
text to line up you need to use a fixed pitch font. You do this
by opening each, changing the font settings, and then closing
them, in advance of any need to use them.
Quote
Alternatively for a larger file you can use wordpad, but you need START
to call that program

exec(getenv('COMSPEC'),'/C start WORDPAD.exe /p '+filename);
I've never tried the latter.
 

Re:Printing to USB port

On Fri, 14 Nov 2003 21:15:14 +0000, Jim Higgins wrote:
Quote
On Thu, 13 Nov 2003 11:07:28 -0500, in
< XXXX@XXXXX.COM >, BillV
< XXXX@XXXXX.COM >wrote:

>Bought a WinXP machine and a new printer. The printer connects to a
>USB port only and unless I copy the *.PAS file to a *.TXT file, it
>will not print. Does anyone know how to somehow connect LTP1 and USB?
>Tried "Copy filename.ext PRN", and that doesn't work.

The following code copied from an earlier posting by Femme
Verbeek with my own comments added:
=======
>If the USB printer is the default printer, the trick is to write the
>info to a file first and next to use a windows program to do the
>printing for you:
>e.g.
>
>uses Dos;
>
>{$M 8192,0,0}
>
>procedure PrintFile (Filename : string);
>begin
>SwapVectors;
>Exec(getenv('COMSPEC'),'/C notePAD.exe /p '+Filename);{}
>SwapVectors;
>end;
>will do the trick.

The above has worked for me for some time. Be sure to preset the
font used by Notepad (and WordPad below) to one that is properly
spaced for your style of Pascal output. If you want formatted
text to line up you need to use a fixed pitch font. You do this
by opening each, changing the font settings, and then closing
them, in advance of any need to use them.

>Alternatively for a larger file you can use wordpad, but you need START
>to call that program
>
>exec(getenv('COMSPEC'),'/C start WORDPAD.exe /p '+filename);

I've never tried the latter.
Why not just map your USB printer to LPT1/2/3/whatever via WinXP - or does
XP not allow this sort of thing?
--
Also too, never, ever use repetitive redundancies.
 

{smallsort}

Re:Printing to USB port

Resolved all my printing problems the good old fashioned way... I
returned the USB only printer and spent the extra money for one that
uses both USB and Parallel ports. After setting up LPT1 everything
worked fine AFTER going into "Printer Setup" found under "File" in the
Pascal programming window and changing /EPSON to /HP.
On Fri, 14 Nov 2003 22:29:57 +0000, Brian < XXXX@XXXXX.COM >wrote:
Quote
On Fri, 14 Nov 2003 21:15:14 +0000, Jim Higgins wrote:

>On Thu, 13 Nov 2003 11:07:28 -0500, in
>< XXXX@XXXXX.COM >, BillV
>< XXXX@XXXXX.COM >wrote:
>
>>Bought a WinXP machine and a new printer. The printer connects to a
>>USB port only and unless I copy the *.PAS file to a *.TXT file, it
>>will not print. Does anyone know how to somehow connect LTP1 and USB?
>>Tried "Copy filename.ext PRN", and that doesn't work.
>
>The following code copied from an earlier posting by Femme
>Verbeek with my own comments added:
>=======
>>If the USB printer is the default printer, the trick is to write the
>>info to a file first and next to use a windows program to do the
>>printing for you:
>>e.g.
>>
>>uses Dos;
>>
>>{$M 8192,0,0}
>>
>>procedure PrintFile (Filename : string);
>>begin
>>SwapVectors;
>>Exec(getenv('COMSPEC'),'/C notePAD.exe /p '+Filename);{}
>>SwapVectors;
>>end;
>>will do the trick.
>
>The above has worked for me for some time. Be sure to preset the
>font used by Notepad (and WordPad below) to one that is properly
>spaced for your style of Pascal output. If you want formatted
>text to line up you need to use a fixed pitch font. You do this
>by opening each, changing the font settings, and then closing
>them, in advance of any need to use them.
>
>>Alternatively for a larger file you can use wordpad, but you need START
>>to call that program
>>
>>exec(getenv('COMSPEC'),'/C start WORDPAD.exe /p '+filename);
>
>I've never tried the latter.

Why not just map your USB printer to LPT1/2/3/whatever via WinXP - or does
XP not allow this sort of thing?
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 

Re:Printing to USB port

On Fri, 14 Nov 2003 22:29:57 +0000, in
<bp3l15$3bs$1$ XXXX@XXXXX.COM >, Brian
< XXXX@XXXXX.COM >wrote:
Quote
On Fri, 14 Nov 2003 21:15:14 +0000, Jim Higgins wrote:

>On Thu, 13 Nov 2003 11:07:28 -0500, in
>< XXXX@XXXXX.COM >, BillV
>< XXXX@XXXXX.COM >wrote:
>
>>Bought a WinXP machine and a new printer. The printer connects to a
>>USB port only and unless I copy the *.PAS file to a *.TXT file, it
>>will not print. Does anyone know how to somehow connect LTP1 and USB?
>>Tried "Copy filename.ext PRN", and that doesn't work.
>
>The following code copied from an earlier posting by Femme
>Verbeek with my own comments added:
>=======
>>If the USB printer is the default printer, the trick is to write the
>>info to a file first and next to use a windows program to do the
>>printing for you:
>>e.g.
>>
>>uses Dos;
>>
>>{$M 8192,0,0}
>>
>>procedure PrintFile (Filename : string);
>>begin
>>SwapVectors;
>>Exec(getenv('COMSPEC'),'/C notePAD.exe /p '+Filename);{}
>>SwapVectors;
>>end;
>>will do the trick.
>
>The above has worked for me for some time. Be sure to preset the
>font used by Notepad (and WordPad below) to one that is properly
>spaced for your style of Pascal output. If you want formatted
>text to line up you need to use a fixed pitch font. You do this
>by opening each, changing the font settings, and then closing
>them, in advance of any need to use them.
>
>>Alternatively for a larger file you can use wordpad, but you need START
>>to call that program
>>
>>exec(getenv('COMSPEC'),'/C start WORDPAD.exe /p '+filename);
>
>I've never tried the latter.

Why not just map your USB printer to LPT1/2/3/whatever via WinXP - or does
XP not allow this sort of thing?
It's your suggestion so you tell us - does it or doesn't it?
 

Re:Printing to USB port

On Sat, 15 Nov 2003 13:41:39 +0000, Jim Higgins wrote:
[snips]
Quote
It's your suggestion so you tell us - does it or doesn't it?

Er, because it was just a suggestion? Umm, because I don't have XP?
But maybe I'm over-estimating the investigative abilities (often aka
"button pushing abilities") of certain readers. Or possibly the
capabilities of XP - it does seem to have been dumbed down somwehat.
Prior versions would happily map LPTx to a networked printer device and as
mapping to a USB-based printer would need to essentially perform the same
actions, I thought it might be worth a look.
But since you're posting via Windows (whereas I was/am not), why don't
*you* have a look?
B.
--
Artificial Intelligence is no match for natural stupidity.
 

Re:Printing to USB port

On Sun, 16 Nov 2003 23:01:04 +0000, in
<bp8vjg$aed$1$ XXXX@XXXXX.COM >, Brian
< XXXX@XXXXX.COM >wrote:
Quote
On Sat, 15 Nov 2003 13:41:39 +0000, Jim Higgins wrote:

[snips]
>It's your suggestion so you tell us - does it or doesn't it?
>
Er, because it was just a suggestion? Umm, because I don't have XP?
But maybe I'm over-estimating the investigative abilities (often aka
"button pushing abilities") of certain readers. Or possibly the
capabilities of XP - it does seem to have been dumbed down somwehat.

Prior versions would happily map LPTx to a networked printer device and as
mapping to a USB-based printer would need to essentially perform the same
actions, I thought it might be worth a look.
Indeed... if BP7 could access a printer networked under
Win2000/XP it would be worth a very close look.
Quote
But since you're posting via Windows (whereas I was/am not), why don't
*you* have a look?
You completely missed my point - something for which I accept
full blame for being too subtle. The point, rephrased so as to
remove ambiguity, was if you don't use Windows and don't know,
why are you giving advice?
--
Jim Higgins, quasimodo AT yahoo DOT com
icbm: 33.55.34N, 80.24.21W
 

Re:Printing to USB port

On Mon, 17 Nov 2003 22:16:59 +0000, Jim Higgins wrote:
Quote
On Sun, 16 Nov 2003 23:01:04 +0000, in
<bp8vjg$aed$1$ XXXX@XXXXX.COM >, Brian
< XXXX@XXXXX.COM >wrote:

>On Sat, 15 Nov 2003 13:41:39 +0000, Jim Higgins wrote:
>
>[snips]
>>It's your suggestion so you tell us - does it or doesn't it?
>>
>Er, because it was just a suggestion? Umm, because I don't have XP?
>But maybe I'm over-estimating the investigative abilities (often aka
>"button pushing abilities") of certain readers. Or possibly the
>capabilities of XP - it does seem to have been dumbed down somwehat.
>
>Prior versions would happily map LPTx to a networked printer device and as
>mapping to a USB-based printer would need to essentially perform the same
>actions, I thought it might be worth a look.

Indeed... if BP7 could access a printer networked under
Win2000/XP it would be worth a very close look.

But this is the point I'm trying to make - when a networked printer is
mapped via Windows to LPTx, it *becomes* accessible as LPTx - and
therefore available to DOS-based applications *as* LPTx. That it is
actually a networked printer is rendered invisible by the act of mapping
it - Windows simply provides another method of accessing the same physical
device which retains compatiblity with DOS-based applications, leaving the
original networked printer available through Windows as-is, or as LPTx.
Like when Windows maps a networked drive as (say) F: - as far as DOS-based
applications are concerned it's just another drive, and not aware that it
might be on some server - which may not even be running MS software - in
another building several miles away.
And really; if BP7 could *directly* access a networked printer (I'll
expand this to mean "any printer using a logical port/device name not
available to DOS") then the original question wouldn't have been raised,
now would it?
Quote
>But since you're posting via Windows (whereas I was/am not), why don't
>*you* have a look?

You completely missed my point - something for which I accept
full blame for being too subtle. The point, rephrased so as to
remove ambiguity, was if you don't use Windows and don't know,
why are you giving advice?

Hmmm - that's an interesting concept: because I'm not running Windows I'm
invalidated from giving any suggestions about using it?
I have a functional memory, and it's not like I've never used Windows: in
fact the last time I used it in any depth (as Win98) I *had* a networked
printer mapped to LPT1 and it *was* accessible in a DOS session as LPT1.
That's the whole point of the GUI interface providing printer port mapping.
I'm quite happy to accept that things may have been changed in XP such
that this sort of functionality has been dropped from the GUI. I don't
think I'd agree this would be a useful OS enhancement, though.
I'm not claiming it *will* work with BP7 - my use of a mapped LPT1 was via
well-behaved applications accessing the device name "LPT1:" - but this is
another reason why I only suggested it might be worth a look.
If it doesn't work with BP specifically - well, back to the drawing board
I guess. But I would certainly expect printer mapping to work with BP7
applications written to write to the device "LPT1:".
Instead of trying to box me off, why don't you just explore Windows'
printer properties and have a look-see? I'm not about to go and buy XP
and press the buttons for you.
B.
--
"Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read." -Groucho Marx
 

Re:Printing to USB port

On Wed, 19 Nov 2003 13:04:05 +0000, in
<bpfpo3$leo$1$ XXXX@XXXXX.COM >, Brian
< XXXX@XXXXX.COM >wrote:
Quote
On Mon, 17 Nov 2003 22:16:59 +0000, Jim Higgins wrote:

>On Sun, 16 Nov 2003 23:01:04 +0000, in
><bp8vjg$aed$1$ XXXX@XXXXX.COM >, Brian
>< XXXX@XXXXX.COM >wrote:
>
>>On Sat, 15 Nov 2003 13:41:39 +0000, Jim Higgins wrote:
>>
>>[snips]
>>>It's your suggestion so you tell us - does it or doesn't it?
>>>
>>Er, because it was just a suggestion? Umm, because I don't have XP?
>>But maybe I'm over-estimating the investigative abilities (often aka
>>"button pushing abilities") of certain readers. Or possibly the
>>capabilities of XP - it does seem to have been dumbed down somwehat.
>>
>>Prior versions would happily map LPTx to a networked printer device and as
>>mapping to a USB-based printer would need to essentially perform the same
>>actions, I thought it might be worth a look.
>
>Indeed... if BP7 could access a printer networked under
>Win2000/XP it would be worth a very close look.
>
But this is the point I'm trying to make - when a networked printer is
mapped via Windows to LPTx, it *becomes* accessible as LPTx - and
therefore available to DOS-based applications *as* LPTx. That it is
actually a networked printer is rendered invisible by the act of mapping
it - Windows simply provides another method of accessing the same physical
device which retains compatiblity with DOS-based applications, leaving the
original networked printer available through Windows as-is, or as LPTx.
Like when Windows maps a networked drive as (say) F: - as far as DOS-based
applications are concerned it's just another drive, and not aware that it
might be on some server - which may not even be running MS software - in
another building several miles away.

And really; if BP7 could *directly* access a networked printer (I'll
expand this to mean "any printer using a logical port/device name not
available to DOS") then the original question wouldn't have been raised,
now would it?

>>But since you're posting via Windows (whereas I was/am not), why don't
>>*you* have a look?
>
>You completely missed my point - something for which I accept
>full blame for being too subtle. The point, rephrased so as to
>remove ambiguity, was if you don't use Windows and don't know,
>why are you giving advice?
>
Hmmm - that's an interesting concept: because I'm not running Windows I'm
invalidated from giving any suggestions about using it?

I have a functional memory, and it's not like I've never used Windows: in
fact the last time I used it in any depth (as Win98) I *had* a networked
printer mapped to LPT1 and it *was* accessible in a DOS session as LPT1.
That's the whole point of the GUI interface providing printer port mapping.

I'm quite happy to accept that things may have been changed in XP such
that this sort of functionality has been dropped from the GUI. I don't
think I'd agree this would be a useful OS enhancement, though.

I'm not claiming it *will* work with BP7 - my use of a mapped LPT1 was via
well-behaved applications accessing the device name "LPT1:" - but this is
another reason why I only suggested it might be worth a look.
If it doesn't work with BP specifically - well, back to the drawing board
I guess. But I would certainly expect printer mapping to work with BP7
applications written to write to the device "LPT1:".

Instead of trying to box me off, why don't you just explore Windows'
printer properties and have a look-see? I'm not about to go and buy XP
and press the buttons for you.
OK... now understand that Win2000/XP are different animals from
Win3x/9x/Me and consider updating your knowledge base before
trying to send folks on a fools mission. You can no longer refer
accurately to just "Windows;" you need to pay attention to the
version involved.
 

Re:Printing to USB port

On Wed, 19 Nov 2003 15:30:57 +0000, Jim Higgins wrote:
[snips]
Quote

OK... now understand that Win2000/XP are different animals from
Win3x/9x/Me and consider updating your knowledge base before
trying to send folks on a fools mission. You can no longer refer
accurately to just "Windows;" you need to pay attention to the
version involved.

Yes, I'm well aware of the zoological differences between Windows
releases.
I don't see anything "fool's mission" about my suggestion of mapping a
device not available under DOS to another device which is - you might also
want to refer to my followup to the thread "Borland Pascal 7 and USB",
since it shows that LPT1 remains accessible to a DOS application running
under Win2k even though the physical printer mapped to it is networked.
You claim, in the same thread, that this won't work. (or on a more
generous note, you simply made a typo)
And as the OP was only asking "... how to somehow connect LPT1 and USB", I
maintain it was worth a quick look. (although no longer by the OP, who
has since found the most fiddle-free method: use a printer which connects
directly to LPT1 - and who, incidentally, provides the additional clue
that he was apparently trying to print from the BP IDE: quite a different
type of request as I've already commented on)
Creating a well-behaved DOS application which accesses a printer as device
"LPT1" instead of the physical I/O port for LPT1 remains as valid for
WinXP as it does for Win3x - and likewise for any OS which expects to
retain control of physical devices.
B.
--
If 'self' is an illusion, who is being fooled?