A BASIC text editor

Show us your work, thrill and amaze us :)

Moderator: Programming Moderators

Magnus
Posts: 6
Joined: Thu May 21, 2020 1:48 pm

A BASIC text editor

Postby Magnus » Sun Jan 03, 2021 10:37 am

Here is a text editor that I built over the holidays as a learning exercise in NextBASIC. It is mostly a proof of concept, and it has some limitations (and probably a few bugs). The major limitation is that it can only handle small files - no more than 70 paragraphs, each with up to 256 characters, and a maximum total size of 16 kB.

One thing to note before you try this is that since I use the SAVE command in BASIC, files saved with this program will have the +3 header, which can cause problems. For example, the dot command .txt2bas can't process files with this header. Also, if you view a file with the .more command, it will display the header. Maybe I can find a way to save files with a machine code routine without the header, but I need to investigate that.
Editor.png
Editor.png (28.72 KiB) Viewed 5205 times
Edit: The latest version is available here: https://github.com/MagnusKrook/ZXNext-Editor
Attachments
Editor 0.1.zip
(12.37 KiB) Downloaded 75 times
Last edited by Magnus on Sat Jan 16, 2021 10:15 am, edited 1 time in total.

Magnus
Posts: 6
Joined: Thu May 21, 2020 1:48 pm

Re: A BASIC text editor

Postby Magnus » Mon Jan 04, 2021 10:08 am

A small update to version 0.2, which now uses the EXTRACT dot command to remove the +3 header from saved files (this can be turned off by setting RemoveHeader=0 on line 140). Also, some bug fixes.
Attachments
Editor 0.2.zip
(13.3 KiB) Downloaded 73 times

User avatar
cha05e90
Posts: 32
Joined: Tue Jun 27, 2017 2:53 pm
Location: Germany
Contact:

Re: A BASIC text editor

Postby cha05e90 » Mon Jan 04, 2021 4:10 pm

Hi!

Oh, very nice. Just tested the 0.2 version - looks promising. As someone who once wrote an text editor in Sinclair BASIC on a classic 3,5 MHz machine I'm sure a Next can do that much better (and faster). Thanks for the effort!
48K/+/+/+128K/Next

Magnus
Posts: 6
Joined: Thu May 21, 2020 1:48 pm

Re: A BASIC text editor

Postby Magnus » Mon Jan 04, 2021 7:14 pm

cha05e90 wrote:
Mon Jan 04, 2021 4:10 pm
Hi!

Oh, very nice. Just tested the 0.2 version - looks promising. As someone who once wrote an text editor in Sinclair BASIC on a classic 3,5 MHz machine I'm sure a Next can do that much better (and faster). Thanks for the effort!
Thank you, glad you like it :). The CPU speed makes a lot of difference of course, but there are also some very powerful commands and functions in NextBASIC, which makes the Next really fun to program.

Magnus
Posts: 6
Joined: Thu May 21, 2020 1:48 pm

Re: A BASIC text editor

Postby Magnus » Sat Jan 16, 2021 10:14 am

I have made a new version (0.3) with basic mouse support (you can place the cursor in the text with the mouse). There is also a separate .bas file with procedures, which are loaded into a separate bank to free up some memory for the main program.

The program is available here: https://github.com/MagnusKrook/ZXNext-Editor


Who is online

Users browsing this forum: No registered users and 1 guest