Quickbasic printing problem 
Author Message
 Quickbasic printing problem

I am posting this for a friend who doesn't have Internet access.  I
will pass any responses on to him, and post his responses on the Net.

He is trying to send an escape sequence to his printer which ends with
a chr(13).  Ordinarily, this would be a carriage return character, but
in this context, it is part of a multi-byte escape sequence.
Quickbasic treats it as a carriage return, adding an unnecessary
linefeed after the byte.  If he opens a binary file on the disk,
writes the text, including the escape sequence, to the file, and then
copies the file to the printer from outside Quickbasic, everything
works as he intends.  Is there any way to use a print command
containing a chr(13) without the linefeed being added?  He has already
tried opening a binary file with a filename of "LPT1", but the result
was no output at all.  Apparently, Quickbasic, or MS-DOS, is
recognizing this as a reserved name, but is neither sending the output
to the printer nor writing it to a file.
--

PGP key available from http://www.*-*-*.com/
--
"There must be, not a balance of power, but a community of power;
not organized rivalries, but an organized common peace." - Woodrow Wilson



Tue, 11 Jul 2000 03:00:00 GMT  
 Quickbasic printing problem

Quote:

> He is trying to send an escape sequence to his printer which ends with
> a chr(13).

Try:

 OPEN "LPT1:BIN" FOR OUTPUT as #1
 PRINT #1, Chr$(27);chr$(13);chr$(44)  ' just some imaginary esc.seq
 CLOSE #1



Tue, 11 Jul 2000 03:00:00 GMT  
 Quickbasic printing problem

Quote:

> He is trying to send an escape sequence to his printer which ends with
> a chr(13).  Ordinarily, this would be a carriage return character, but
> in this context, it is part of a multi-byte escape sequence.
> Quickbasic treats it as a carriage return, adding an unnecessary
> linefeed after the byte.  If he opens a binary file on the disk,
> writes the text, including the escape sequence, to the file, and then
> copies the file to the printer from outside Quickbasic, everything
> works as he intends.  Is there any way to use a print command
> containing a chr(13) without the linefeed being added?  He has already
> --


Did you try putting a semi-colon after the print statement?

--
Delhi, La.,  Gateway to:   Poverty Point  Archaeological Center
Site of the oldest  pre-historic  civilization in North America
Personal Home
Page:,...........HTTP://cust2.iamerica.net/cgodard          
Business Home Page:............HTTP://cust.iamerica.net/ggodard      
KA5EJW  Advanced Class Ham     FCC General Class
Radiotelephone                                



Tue, 11 Jul 2000 03:00:00 GMT  
 Quickbasic printing problem



Quote:
>He is trying to send an escape sequence to his printer which ends with
>a chr(13).  Ordinarily, this would be a carriage return character, but
>in this context, it is part of a multi-byte escape sequence.
>Quickbasic treats it as a carriage return, adding an unnecessary
>linefeed after the byte.  If he opens a binary file on the disk,
>writes the text, including the escape sequence, to the file, and then
>copies the file to the printer from outside Quickbasic, everything
>works as he intends.  Is there any way to use a print command
>containing a chr(13) without the linefeed being added?  He has already
>tried opening a binary file with a filename of "LPT1", but the result
>was no output at all.  Apparently, Quickbasic, or MS-DOS, is
>recognizing this as a reserved name, but is neither sending the output
>to the printer nor writing it to a file.

Sending info/commands to the printer is done like this...

LPRINT CHR$(27)+CHR$(68)+CHR$(13);

Note the simicolon at the end...
Then, depending on the make/model of the printer some commands REQUIRE that
other commands have been sent first before they work correctly and/or later
commands will reset what has gone before. I'd rather write a meg of
screen/file code than a k of printer code!

C'ya,

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian



Tue, 11 Jul 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. printing windows documents from quickbasic

2. Printing from Mac QuickBASIC

3. QuickBasic and Print Screen

4. converting quickbasic code to ascii, or vb, or anything besides quickbasic

5. QuickBasic printer problem

6. QuickBasic (4.0/4.5) Problem (Real Mess)

7. MS-Quickbasic numeric range problem

8. Quickbasic String Space Problems

9. QuickBASIC Problems

10. Problem with $INCLUDE under QuickBASIC 4.0

11. Problems with QuickBasic 4.5

12. Problem with linking a QuickBASIC program (urgent!!!!!)

 

 
Powered by phpBB® Forum Software