Forums: Forum of Decimal BASIC (Thread #39361)

Can I pass control codes to printer? (2018-03-19 06:32 by toml12953 #80975)

I'd like to print from Decimal BASIC to a PCL3 printer in landscape mode. No matter what I try it doesn't work.
I tried setting landscape mode in the print driver but the print from Decimal still comes out portrait.
I tried sending the proper command code:

OPEN #1:PRINTER
PRINT #1:CHR$(27);"&l1O"
PRINT #1: "This is a test"
CLOSE #1
END

The Escape (CHR$(27)) seems to be printed as a special character rather than setting the printer in command mode.
Is there any way to get Decimal to print Landscape? Even if Decimal could be changed to respect the current settings of the print driver, that would be better than nothing.

Reply to #80975×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: Can I pass control codes to printer? (2018-03-20 08:45 by SHIRAISHI Kazuo #80976)

If you know the LPT port where the printer is connected, you can use the port to output the control sequece.
Sample.

10 OPEN #1: NAME "LPT1:"
20 FOR i=1 TO 10
30 INPUT n
40 PRINT #1: n,SQR(n)
50 NEXT i
60 CLOSE #1
70 END


Reply to #80975

Reply to #80976×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login