Export Basic listing

By thegeps

Paragon (1175)

Аватар пользователя thegeps

18-05-2019, 17:31

Is there a way to export Basic listing out of openMSX? I mean: I've coded a small breakout clone in msx-basic and I want to export its listing in a txt file, so I can modify it faster (moving large number of rows with copy and paste), and look at all the listing just by going up and down in a file... I just saw I can import a listing from a txt using catapult and sending text by clicking on type button so for that part of needing I'm fine... (I used diskmanipulator to export a disk content to a folder but the listings have been exported as bin, despite I've saved them with SAVE command in msx basic. Also tried to force asc saving them like SAVE"break.txt", SAVE"break.bas", SAVE"break.asc" but I had everytime a bin file, as prompted by TED)

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By Jipe

Paragon (1603)

Аватар пользователя Jipe

18-05-2019, 17:52

SAVE "break.bas",A for ASCII format

By Poltergeist

Champion (280)

Аватар пользователя Poltergeist

18-05-2019, 17:52

Save '' filename.Bas'', a

By Manuel

Ascended (19303)

Аватар пользователя Manuel

18-05-2019, 17:59

And you can also just load the ASCII file without any conversion, using dir-as-disk, you don't need the type command at all and you don't need diskmanipulator to import/export.

By thegeps

Paragon (1175)

Аватар пользователя thegeps

18-05-2019, 22:26

thank you all!

By FiXato

Scribe (1742)

Аватар пользователя FiXato

12-05-2021, 13:08

If you want to avoid having to export to a file, and prefer to have it just appear in your clipboard, you can try:

set_clipboard_text [ regsub -all -line {^[0-9a-f]x[0-9a-f]{4} > } [ listing ] "" ]

Or copy the raw tcl file from my listing_manipulation.tcl gist to your openMSX/share/scripts/ directory (typically C:\Users\$YOURUSERNAME\Documents\openMSX\share\scripts on Windows and ~/.openmsx/share/scripts on *NIX), and you'll have a copy_ascii_listing_to_clipboard in your console, which you can optionally bind to a keyboard combination too.

By Gregory

Master (222)

Аватар пользователя Gregory

24-08-2021, 15:53

Does blueMSX offer the same possibility? Don't see any buttons that let you save a file.

By Manuel

Ascended (19303)

Аватар пользователя Manuel

24-08-2021, 21:15

The easiest way for me is:
in the console:

set printerlogfilename /tmp/output.txt
plug printerport logger 

Then in MSX-BASIC: llist

and then back in the console:
unplug printerport
And the listing is in /tmp/output.txt file.

By Karlson

Supporter (2)

Аватар пользователя Karlson

21-12-2021, 17:28

your method runs perfect

By santiontanon

Paragon (1770)

Аватар пользователя santiontanon

21-12-2021, 18:08

Manuel wrote:

The easiest way for me is:
in the console:

set printerlogfilename /tmp/output.txt
plug printerport logger 

Then in MSX-BASIC: llist

and then back in the console:
unplug printerport
And the listing is in /tmp/output.txt file.

A bit off topic, but I just wanted to say that I don't know who came up with the idea to add the console and command API to openMSX, but it is brilliant. From the developer's point of view, I don't know of any other emulator for any other system that is as powerful as openMSX is thanks to this.

By Manuel

Ascended (19303)

Аватар пользователя Manuel

21-12-2021, 21:08

Well, who can remember, as the first steps were added (by turbor) in January 2002, yes, that's about 20 years ago....

But yeah, thanks. I use it all the time, as a power user from before there was anything else Smile