QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: bjg201 on December 31, 2020, 07:11:19 pm

Title: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: bjg201 on December 31, 2020, 07:11:19 pm
I just downloaded QB64 on Win 10, 64 bit.  How do I print a program listing as there is no PRINT command on the FILE menu.
Title: Re: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: bplus on December 31, 2020, 07:37:18 pm
Could copy/paste it into your favorite word processor and print from there.

Otherwise you have to code something.

Welcome to the forum.
Title: Re: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: Dav on December 31, 2020, 08:45:04 pm
I almost didn't post this as the IDE is so old now...but you can print source code from my QB64 IDE.  Please note, I haven't tested it in Windows 10.  Also, my IDE doesn't recognize many new commands found in the current version of QB64, but that shouldn't affect printing.
http://www.qbasicnews.com/dav/projects.php#DAVSIDE (http://www.qbasicnews.com/dav/projects.php#DAVSIDE)

- Dav
Title: Re: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: Pete on December 31, 2020, 08:47:29 pm
Let's say you have a program called: myprogram.bas

Open the QB64 IDE and paste in this code...

SHELL _DONTWAIT(START Notepad /min /p myprogram.bas"

Run the program. It's okay that the program is "Untitled." It will still run, without being saved.

So what this does is tell Notepad to open minimized, open your program called myprogram.bas in this example case, and then the /p switch prints it. Note the START command allows the /min switch to be used. It isn't necessary to run Notepad minimized, but it's nice to have it out of the way.

Welcome to the forum, and this is funny, because I was just thinking the other day it would be nice if a PRINT option was added, at some point, to the project. I'm just not sure with all the cross-platform printing issues if that is too complicated an undertaking, and the use, frankly, would be minimal, which would not make this a priority for the dev team.

Hey Dav, you posted while I was writing this.Nice to see your IDE prints, but is it cross-platform compatible?

Pete
Title: Re: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: Dav on December 31, 2020, 08:51:57 pm
Hey Pete. No, it's just for Windows Im afraid.

Happy new year to you...

- Dav
Title: Re: How do you print a program listing from the QB64 shell No PRINT on FILE menu.
Post by: Pete on December 31, 2020, 09:25:34 pm
Thanks for the reply. I was expecting Dav's not here, man! Oh wait, that's my bit.

Happy New Year back at you!

Pete