How to open a NextBASIC .bas file for editing on Mac?

This is where most of us started. Classic Spectrum basic.

Moderator: Programming Moderators

User avatar
Daeve
Posts: 128
Joined: Mon May 29, 2017 7:28 pm
Location: Leicester, UK
Contact:

How to open a NextBASIC .bas file for editing on Mac?

Postby Daeve » Sun May 10, 2020 9:10 am

Hi, I've been trying to learn some NextBASIC and I've been working through the excellent tutorials by Darryl Sloan on YouTube, and tried to write some other programs myself. I now want to transcribe the code into a word document (or similar) and comment it in much more detail than I can in a REM, so that I can come back to it in the future and still make sense of it.

The trouble is I can't seem to find anything to open the NextBASIC .BAS files I've written so far on my Mac - when I open in TextEdit, it generates partial listing but with no line numbers.

Code: Select all

PLUS3DOS¿@pÄ@´
ÍCONNECT 4
KÍImport aprite data into bank 16 of RAM starting at 0 for 1280 bytes long 
+Ô"connect.spr"ö16,0,1280
(ûö16
2û˝:ûı1 
»Íset up board
…MÍsprite command sprite#,x-pos,y-pos,pattern# from .spr file,1 or 0 on or off
+û1,502,502,2,1
So I guess what I'm asking is - "How do I get the basic listing I've already typed in and saved on the Spectrum Next off the Next and into a document?". Yes, I could type them in again directly into Word, but I've quite a few now and that would take quite a long time and I'd likely lose my enthusiasm along the way.

I thought about an emulator and maybe it'd let me copy/paste - I installed zesarux on my Mac, which works and loads next snapshots - but I can't for the life of me figure out how to open NextBASIC in it! :x

Any help gratefully received.

Ped7g
Posts: 255
Joined: Mon Jul 16, 2018 7:11 pm

Re: How to open a NextBASIC .bas file for editing on Mac?

Postby Ped7g » Sun May 10, 2020 11:27 am

there is dot command ".bas2txt" (and the other direction one ".txt2bas"). So you can prepare TXT version of your NextBASIC program directly on the Next and then open on Mac the TXT file.

This is probably recommended way for few transformations from time to time, as the tools are maintained directly by Garry and are always most up to date. There is some work done by other people mostly on the txt->bas direction directly on the PC, as that makes programming on PC side in some kind of IDE less error prone, but one should better examine current status of such tool, how up to date it is with current NextZXOS.

User avatar
Daeve
Posts: 128
Joined: Mon May 29, 2017 7:28 pm
Location: Leicester, UK
Contact:

Re: How to open a NextBASIC .bas file for editing on Mac?

Postby Daeve » Sun May 10, 2020 1:46 pm

Brilliant, thanks. This seems like the simplest way for now.

User avatar
mitja_i
Posts: 368
Joined: Tue May 30, 2017 6:27 am
Location: Ljubljana, Slovenia
Contact:

Re: How to open a NextBASIC .bas file for editing on Mac?

Postby mitja_i » Mon May 11, 2020 9:59 am

There is also this Remy's online tool: https://zx.remysharp.com/bas/
Backer 423 @ 37% funded, 10th hour. Base version. Shipping nr. 533. Received February 19, 2020.
Backer 1027 @ 141% funded, 10th minute.

Original 48K (issue 4b) with IF1, two microdrives and vDrive.
---
ZX Spectrum Next glossary

User avatar
remysharp
Posts: 14
Joined: Wed Mar 04, 2020 5:06 pm

Re: How to open a NextBASIC .bas file for editing on Mac?

Postby remysharp » Thu May 28, 2020 10:55 am

I've been working on tooling around this kind of problem (since there's a boat load for Windows!). As @mitja_i said, I've published an online tool at https://zx.remysharp.com/bas/ - you can drag and drop NextBASIC files directly into the window and it'll render it just fine. The online tool has some validation built in too if you wanted to code directly in the browser.

Also I wrote a vscode extension which supports importing and converting .bas files: https://marketplace.visualstudio.com/it ... .nextbasic

Finally, if you want to use the command line, the code that works in both of those tools is here: https://www.npmjs.com/package/txt2bas - which installs a command line tool with txt2bas and bas2txt (all tooling also supports the directives that txt2bas support, like #autoline and #autostart).
My ZX Spectrum Next tooling: https://zx.remysharp.com


Who is online

Users browsing this forum: No registered users and 3 guests