Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - radio-hobby

Pages: [1]
1
Thank you, I think I'm on the way...  I'm going to study it the way you showed to me by reading the headers of example .rtf files...
Thank you for the link to knowledge of .rtf formatting.
Thank you all for your work on QB64 and for your help!!!
Georg

2
Hope it's o.k. to you if I post my proceedings here.

1st step was to look whether the SHELL command lines would really work with my computer.
I wrote a .rtf file on an old Win XP computer, transfered it to the Win10 computer and tried to print it using your SHELL command lines.
Only in the beginning they didn't work.

Thus I searched for wordpad on Win10 computers. You'll find it under C:\program files (x86)\windows nt\accessories
Then I told win10 to always open .rtf files with this wordpad.
I think this was neccessary, otherwise your SHELL command lines would not work.

After that, thank you, Pete, your SHELL command lines work well now.

Next I'll try to write some .rtf text file by QB64 the way you showed to me.
Please provide me if possible with some information how to change fonts within the text, and what the content of the header is.
Even after some contemplation over your commands following PRINT #1, I did not understand much.
What I understood is that your knowledge about .rtf files is very detailed, my respect.
My goal is to print a DIN A4 letter with the name of the sender in bigger letters on top right, then very tiny small lines (planned to fit in the upper part of the window of the envelope) with name and adress of the sender, then normal size for the adress, the text and so on. I guess I can do it if I know how to change font within the text.

Thank you very much in advance,
Georg

3
Thank you Pete and Petr,
I will try to write a .rtf file from qb64. Thank you for providing those SHELL commands I did not know before to start the printout of the .rtf file by wordpad.
Hope I understand what to write into the header - I'll try to copy like "black box". Thanks again.
Georg

4
Hello specialists,
I'm just a beginner since 40 years...

With Windows XP (32 bit) using QBASIC and my Epson LQ300 dot matrix printer connected to LPT1: I wrote the printer routine the following way


OPEN "LPT1:" FOR OUTPUT AS #1: WIDTH #1, 150
GOSUB ELITE    ' this subroutine will send some ESC sequences to the EPSON LQ300 in order to switch it to the ELITE character set

' now put some text to the text variable P$
P$ = "This is just some text that you want the EPSON LQ300 to print out." : GOSUB PRINTER
P$ = "And this is a scond line you want to be printed." : GOSUB PRINTER
GOSUB FORMFEED
CLOSE
END



PRINTER: P$ = "      " + P$: PRINT #1, P$: RETURN        ' the printed text is moved to the right a bit, then printed in one line

ELITE:
P$ = CHR$(&H1B) + CHR$(&H40) + CHR$(&H1B) + CHR$(&H78) + CHR$(&H1) + CHR$(&H1B) + CHR$(&H6B) + CHR$(&H1) + CHR$(&H1B) +  CHR$(&H4D)
GOSUB PRINTER: P$ = ""
RETURN

FORMFEED:                            ' the paper comes out of the printer
P$ = CHR$(&HC) : GOSUB PRINTER: P$ = "" : RETURN



Now, with QB64 and today's computers without centronics serial interface LPT1, but the EPSON LQ300 connected via USB001, I was able to get something printed by use of the command LPRINT as follows:


LPRINT "The quick brown fox jumped over the lazy dog"

(Thank you for making this work, indeed!)

But... up to now I did not find out how to send ESC sequences to the printer in order to change the font.

OPEN "USB001" FOR OUTPUT AS #1          did not work, sorry. Instead it produced an error "illegal function call"
P$ = CHR$(&H1B)   .........    LPRINT P$     did not work, either, sorry. Instead it printed some arrows and playing card symbols.

Please indulge me in being without any deeper knowledge,
Georg

Pages: [1]