Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
I have a thermal printer connected to the Pico. Is there any way to print the programme, something like ‘LIST#5’ or ‘LLIST’ as in the Spectrum? Best regards.
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 471
Posted: 02:58pm 19 Oct 2025
Copy link to clipboard
Print this post
How is the printer connected? I have an Epson thermal receipt printer (41 col paper) connected to COM1: and I have this in my library:
SUB LLIST(fname$) OPTION console serial IF fname$="" THEN LIST all ELSE LIST all fname$ END IF PRINT :PRINT :PRINT :PRINT :PRINT PRINT :PRINT OPTION console screen END SUB
All those PRINTs are there because I want the listing to be at the right place to tear off.
SUB LLIST SAVE ‘A:LLIST.BAS’ OPEN ‘A:LLIST.BAS’ FOR INPUT AS #9 DO LINE INPUT #9, L$ DEVICE SERIALTX GP0, 9600, L$ + CHR$(10) + CHR$(13) LOOP UNTIL (EOF#9) PRINT#9:PRINT#9:PRINT#9 CLOSE#9 KILL ‘A:LLIST.BAS’ END SUB
To include it in the library. But your solution is more elegant. I'll make a note of it.