Trouble listing source code

TrueBasic Silver
Windows XP, SP 2

My printer works correctly for all other purposes but I have trouble listing TB source code. The problem is that the printer truncates source code lines longer than 46 charactors--anything beyond 45 % of the available line length on the screen.

The margin and zonewidth of #0 is 88 and 16.
The font size is 10.

As a test I printed the following line to the printer:

Print #1: "!!!!!!!!!!!!!!!!25!!!!!!!!!!!!!!!!!!!!!!!50!!!!!!!!!!!!!!!!!!!!!!!75!!!!!!!!!"

That line occupied nearly all of the screen width and the entire line was printed correctly--except it occupied only about 45 % of one line on 8.5 X 11 printer paper. This is contradictory--a source code line that long on the screen would have been truncated to about 45 % of its real length but the entire test line printed but was compressed into 45 % of the printer line.

What do I have to do to list complete lines of source code?

Jerry Jackson
San Antonio


Trouble listing source code

If the True Basic itself is at fault why not copy and paste your program into some alternative editor and print from within that program. Actually you don't have to do a copy/paste as the TRU files can be opened by any decent editor program.

Trouble listing source code

Thanks Crimsonmini-that was a great idea. I easily opened and printed it through Word without any problems, indicating the problem is in TB. I will see if an upgrade will solve it.


Listing source code

Hi Jerry,

TB versions prior to 5.42 had a bug in the print listing routine. The fault was that the MARGIN was not SET after the printer was opened. In version 5.42 and 5.5b19 this problem was resolved. Here is a DO program that you can run from TrueBASIC that does all or partial listings:


SUB Listing(line$(),arg$)


SET #5: MARGIN maxnum

LET linecount=0
LET char_per_line=80 ! user can change
LET lines_per_page=60 ! user can change

FOR n=1 to ubound(line$)
LET length=len(line$(n))
LET start=1
IF length>char_per_line then
LET linecount=linecount+1
PRINT #5: line$(n)[start:start+char_per_line-1]
LET start=start+char_per_line
LET length=length-start+1
LET linecount=linecount+1
PRINT #5: line$(n)[start:len(line$(n))]
IF linecount=lines_per_page then
PRINT #5: chr$(12) ! page feed
LET linecount=0


Big John

Trouble listing source code

Hi Big John, thanks for the reply. You stated that the bug was corrected in Version 5.5b19 but that is the version that I am having trouble with. Is there a newer version? Any other ideas?



Program listing

Hi Jerry,

The source code for the editor clearly shows that a correction was made some time around version 5.42 so that it is virtually identical to the DO program code that I wrote some years ago. However, when the XVT interface was removed and issue 5.5b19 was released, a new section of code was inserted as the print listing routine. This new code uses a library module called PWLIB.TRC in which TB thinks of the printer as just another window whose co-ordinates are defined by the printer dot density. This means you can print to a much higher quality standard. As far as I know this routine appears to work fine. I will check it out because I have used the same routine in the new version of the editor.

Big John