MAINWIN prints when closed

Discussions about the Liberty BASIC language, with particular reference to LB Booster
Sparks
Posts: 10
Joined: Wed Apr 18, 2018 10:07 pm

MAINWIN prints when closed

Post by Sparks »

The Mainwin has just started printing it's contents when I close it with the "X" in the upper right corner. It just started. Any ideas what's going on?
guest
Site Admin
Posts: 198
Joined: Tue Apr 03, 2018 1:34 pm

Re: MAINWIN prints when closed

Post by guest »

Sparks wrote: Mon Jul 13, 2020 10:29 pm The Mainwin has just started printing it's contents when I close it with the "X" in the upper right corner. It just started. Any ideas what's going on?
You are PRINTing a CHR$(2) to the mainwin. This causes it to send everything subsequently output also to the printer (it's a BBC BASIC feature).

Check your program's PRINT statements carefully; somewhere you are outputting a string which contains a CHR$(2).

This will demonstrate what I mean:

Code: Select all

print chr$(2)
print "This will appear on the printer when the window is closed"
Sparks
Posts: 10
Joined: Wed Apr 18, 2018 10:07 pm

Re: MAINWIN prints when closed

Post by Sparks »

Thanks a bunch, that is the problem