Closed BobMeekKY closed 1 month ago
The flushing after running a program is documented:
When entering direct mode, LPT1: (but not other printers) is flushed and its position is reset to 1.
From the --lpt1
option documentation:
[…] trigger sets an additional trigger to activate the printer:
line
After every line break.page
After every page break.close
No additional triggerThe default is
close
.
Marc, thanks for your reply.
I've read the documentation and tried all 3 of the triggers ... none are working for me. As stated in my post, printing from within a running program (i.e, execution of an LPRINT statement) everything prints perfectly. However, in direct mode when trying to print a section of code (i.e., LLIST 100-300), no output is produced until PC-BASIC is closed. This is very inconvenient.
Since I don't have a parallel printer attached to a physical LPT1 port, I'm using the DOSPRN program to "capture" LPT1 and route it to my network-attached printer. Again, this is working beautifully for print statements executed within a running PC-BASIC program but produces nothing from an LLIST or LPRINT statement executed in direct mode.
If you can get this to work on your end, perhaps you would be willing to share the exact syntax of the --LPT1 setup statement that you're using? Perhaps my problem could be a simple as not using the correct syntax?
I do appreciate your help.
--- Bob Meek
----- Original Message ----- From: Marc Rintsch @.> Reply-To: robhagemans/pcbasic @.> To: robhagemans/pcbasic @.> Cc: BobMeekKY @.>, Author @.***> Sent: 5/11/2024 1:40:08 PM Subject: Re: [robhagemans/pcbasic] LLIST command does not produce output until program is closed (Issue #239)
The flushing after running a program is documented: When entering direct mode, LPT1: (but not other printers) is flushed and its position is reset to 1. From the --lpt1 option documentation: […] trigger sets an additional trigger to activate the printer: line After every line break. page After every page break. close No additional trigger The default is close. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
With the close
option, a page is sent to the printer when the LPT1
file is closed; this happens (1) when a file open to LPT1
is closed explicitly, (2) when a program finishes running, or (3) when exiting PC-BASIC. This is why LPRINT
or LLST
in a program will trigger a print but in direct mode this only happens once you exit.
This is intended behaviour; GW-BASIC was designed in a time of tractor-feed line printers, but we have to work with page-based printers, and don't usually want to send out a whole page for every statement, There's no way for PC-BASIC to know when you're finished with outputting to a page on the command line, so it just waits until the end.
If you don't want this, you can
(1) use the line
option, but you will trigger the printer with every carriage return/line feed; i.e. you get a whole page for every line, unless you do have a tractor-feed line printer.
(2) use the page
option and send a Form Feed when you actually want to print the page. I.e. LPRINT CHR$(12)
would trigger a print in page
mode.
Note that, unless you specify LPT1=PARPORT:0
, the output will not be sent to your operating system's LPT1
or any emulated parallel port, it is simply sent directly to your default printer. There is no need for DOSPRN
. If you do want to use DOSPRN
you can try to set LPT1=PARPORT:0
; altough I have no idea whether the two work together as PC-BASIC does not the DOS parallel port system but the one for Windows or whichever OS you use.
I just downloaded and started using the program a few days ago ... and it's absolutely fantastic. The associated documentation is also excellent, but I have one issue that I've not been able to solve. I'm not sure if this is a bug or just something I've not gotten configured properly?
I'm running what I believe to be the latest version (PC-BASIC 2.0.7) on Windows 10 Pro. My printer is a network attached printer. I downloaded and installed the DOSPRN 2.0 program to capture the LPT1 port and route it to my printer. This works perfectly for LPRINT statements in a running program. However, when I use the LLIST command, no output is sent to the printer until I close the PC-BASIC program. As soon as the program is terminated, the printer shoots out the expected output.
In the documentation, I read something about output not being sent until a file is closed. So, I'm wondering if there is a command in PC-BASIC to "close" then "re-open" the LPT1 port? I tried executing the CLOSE command, but that doesn't have any effect. It's like the output is being held within the PC-BASIC program and not released until the program is closed.
If this is a bug, would a possible fix be to build a routine into the program to automatically close/re-open the printer port(s) after every 5 seconds when the program is otherwise idle (i.e., not actively executing a program)?