Flexible BASIC Lister for Windows

handy tools that can assist in the development of new software
Post Reply
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Flexible BASIC Lister for Windows

Post by andrew_rowland »

Yes -- yet another BASIC detokeniser / syntax highlighter! Though I like to think it's a good 'un. Full details and downloads here: https://www.goggleboxtech.uk/rowlandsof ... php?id=998 or get to it from https://rowlandsoftware.com

But why, given that there are already basictool (https://www.stardot.org.uk/forums/viewt ... 55&t=22210) and Ben Ryves's (https://mdfs.net/Apps/WebTools/WebBasic/), to name but two?

Several reasons:
  • I'm an idiot
  • I was trying to do something else and this came out by accident
  • I thought it would be easy and I'd be done by tea-time. It's just a matter of listing each line and expanding the tokens, right?
  • It was initially writing an analyser, and maybe a cruncher, and this was a stepping stone. Writing to the console just helped me check progress and accuracy.
  • I sort of forgot and got carried away.
Anyway, if you're on Windows it can be pretty useful, and I certainly find it handy during the development work I'm doing at the moment. Let me know what you think.
Last edited by andrew_rowland on Sat Jul 08, 2023 4:27 pm, edited 1 time in total.
User avatar
geraldholdsworth
Posts: 1401
Joined: Tue Nov 04, 2014 9:42 pm
Location: Inverness, Scotland
Contact:

Re: Flexible BASIC Lister for Windows

Post by geraldholdsworth »

andrew_rowland wrote: Sat Jul 08, 2023 2:19 pm Full details and downloads here: https://rowlandsoftware.com/BBC/BasList/help.php?id=998
I get an error 404.
andrew_rowland wrote: Sat Jul 08, 2023 2:19 pm But why, given that there are already basictool (https://www.stardot.org.uk/forums/viewt ... 55&t=22210) and Ben Ryves's (https://mdfs.net/Apps/WebTools/WebBasic/), to name but two?
And my multi-platform BBC BASIC Viewer.
andrew_rowland wrote: Sat Jul 08, 2023 2:19 pm Several reasons:
And because you enjoy doing it and because you can.

Oh, and why not?
Gerald Holdsworth, CTS-D
Extron Authorised Programmer
https://www.geraldholdsworth.co.uk
https://www.reptonresourcepage.co.uk
Twitter @radiogezza
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

geraldholdsworth wrote: Sat Jul 08, 2023 3:53 pm
andrew_rowland wrote: Sat Jul 08, 2023 2:19 pm Full details and downloads here:<snip>
I get an error 404.
Oops. Sorry. Corrected the link. It's https://www.goggleboxtech.uk/rowlandsof ... php?id=998
geraldholdsworth wrote: Sat Jul 08, 2023 3:53 pmAnd because you enjoy doing it and because you can.
Oh, and why not?
:D
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Flexible BASIC Lister for Windows

Post by jgharston »

Plus, of course, BBC BASIC library routines to convert BBC BASIC files:
https://mdfs.net/Software/BBCBasic/Tools/

:)

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

jgharston wrote: Sun Jul 09, 2023 12:54 am Plus, of course, BBC BASIC library routines to convert BBC BASIC files:
https://mdfs.net/Software/BBCBasic/Tools/
:)
Yup, though not quite the same purpose, similar under the hood. So that's four at least.
I could have saved days of my life. But mine gives you loads of options, including
  • pausing every screenful
  • syntax colouring
  • listing a range of lines
  • indenting of loops
  • with and without line numbers
  • LIST IF functionality
And the documentation is great. Not boasting, just saying. Well, boasting a bit. Not running anyone else down. At least you guys can Google stuff so you know when it's been done before.
User avatar
geraldholdsworth
Posts: 1401
Joined: Tue Nov 04, 2014 9:42 pm
Location: Inverness, Scotland
Contact:

Re: Flexible BASIC Lister for Windows

Post by geraldholdsworth »

andrew_rowland wrote: Sat Jul 08, 2023 4:29 pm Oops. Sorry. Corrected the link. It's https://www.goggleboxtech.uk/rowlandsof ... php?id=998
Looks very good. Command line driven too - nice. Shame it's only Windows.
I only wrote my application so I could then add it into Disc Image Manager.
Gerald Holdsworth, CTS-D
Extron Authorised Programmer
https://www.geraldholdsworth.co.uk
https://www.reptonresourcepage.co.uk
Twitter @radiogezza
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

geraldholdsworth wrote: Sun Jul 09, 2023 9:48 am Looks very good. Command line driven too - nice. Shame it's only Windows.
I only wrote my application so I could then add it into Disc Image Manager.
Thank you, Gerald. I would like to make it cross-platform. I just use Visual Studio out of a) laziness and b) because I don't know of anything that makes designing windowed applications so easy in Linux. AFAIK VS Code doesn't have a form designer, for example. (Not relevant for BasList, but the eventual aim is for a graphical interface.) And very often, the best IDE is the one you've got and can just start writing in. Open to all suggestions, though.
I am happy to release the code, which is in C#, if anyone would like to collaborate.

Just looked at Disc Image Manager and am impressed. It seems to do everything Jon Welch’s ADFS Explorer does and more. I added a link to it on my BasList page.
markusher
Posts: 345
Joined: Tue Jul 17, 2018 10:55 am
Contact:

Re: Flexible BASIC Lister for Windows

Post by markusher »

Can it re-tokenise an edited basic file? Would be great to be able to do some simple BASIC editing to a file sometimes, like copy and past a section of code.
-Mark
2 x BBC, 1 Viglen BBC, M128, M512, M128+copro, 1 Master ET, BBC AIV Domesday System, E01S, E01, E20 Filestore, 3 x A4000, RISC PC 600,700, StrongArm. Probably more I've missed and all sorts of bits and pieces.
User avatar
geraldholdsworth
Posts: 1401
Joined: Tue Nov 04, 2014 9:42 pm
Location: Inverness, Scotland
Contact:

Re: Flexible BASIC Lister for Windows

Post by geraldholdsworth »

andrew_rowland wrote: Sun Jul 09, 2023 2:02 pm Open to all suggestions, though.
I am happy to release the code, which is in C#, if anyone would like to collaborate.
Have you tried Embacardero's Visual C++? I used to use Delphi, when on Windows. Although I've never used their C++ offering, I can only assume it works (apart from the language) similar to Delphi. You can get a community licence for free too.
andrew_rowland wrote: Sun Jul 09, 2023 2:02 pm Just looked at Disc Image Manager and am impressed. It seems to do everything Jon Welch’s ADFS Explorer does and more. I added a link to it on my BasList page.
Thank you.
Gerald Holdsworth, CTS-D
Extron Authorised Programmer
https://www.geraldholdsworth.co.uk
https://www.reptonresourcepage.co.uk
Twitter @radiogezza
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

markusher wrote: Sun Jul 09, 2023 2:08 pm Can it re-tokenise an edited basic file? Would be great to be able to do some simple BASIC editing to a file sometimes, like copy and paste a section of code.
No, though doing that was a major reason for my starting on this project. It would either have to be a separate command or be integrated into an editor. I would first have to convince myself that Richard Russel's BBC Basic for SDL won't do the job for free, though.
UPDATE: It does, but in Z80 format. Should have guessed...

I do all my editing without line numbers. As a workaround, what I do currently is to import the edited text file back into my BBC Master, load it into EDIT, press Shift-F4 and enter XBAS, which loads it into Basic. Quicker than appending AUTO at the start and EXECing it in.
To do that you need XED and XBAS in the library, which were published in Beebug Vol10 Ed3. I've zipped the stuff you would need here: https://www.goggleboxtech.uk/rowlandsof ... loads.html Note that XBAS incorporates the bug fix that was published in a later edition.
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Flexible BASIC Lister for Windows

Post by jgharston »

andrew_rowland wrote: Mon Jul 10, 2023 11:09 am No, though doing that was a major reason for my starting on this project. It would either have to be a separate command or be integrated into an editor. I would first have to convince myself that Richard Russel's BBC Basic for SDL won't do the job for free, though.
UPDATE: It does, but in Z80 format. Should have guessed...
So, tokenise into Russell format, and then convert to Acorn format. That's what my RISC OS desktop BasConv does, but the other way, for doing Text->Russell.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

jgharston wrote: Mon Jul 10, 2023 12:22 pm So, tokenise into Russell format, and then convert to Acorn format
Yes, that is trivial enough.
Does anyone else use BBC Basic for Windows or for SDL and convert for the BBC?
geraldholdsworth wrote: Sun Jul 09, 2023 3:49 pm Have you tried Embacardero's Visual C++? I used to use Delphi, when on Windows. Although I've never used their C++ offering, I can only assume it works (apart from the language) similar to Delphi. You can get a community licence for free too.
Thanks for the Embacardero suggestion. I had encountered Embacardero before, but had to remind myself about it. The C++ IDE is just for Windows and iOS and the community edition has some pretty annoying restrictions, including the proviso that the licence expires every year and you have to *re-install* to renew it!

Been spoiled by WinForms, I suppose -- something even Microsoft is leaving to wither on the vine now. When I first started out (VB 6!) it was so much better than the clunky messing around with templates and messages in RiscOS. Microsoft then seemed to regress. I wrote a program using WPF but I was very slow. I'm not afraid of XML, but I literally had to Google every single thing I wanted to do.

I dabbled in Java on Linux once. Forget which framework, but I recall Mono. It was weird the way components moved around the place as you resized the window, and you had to make alterations to create a Windows version of your program, so I didn't get far, but that was a number of years ago. Ideally there would be something on Linux that is C-like or Java-like with a graphical form designer, and which exports to other platforms fairly seamlessly. Admittedly, I haven't put much effort into researching this, but I hunt on...
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Flexible BASIC Lister for Windows

Post by jgharston »

andrew_rowland wrote: Mon Jul 10, 2023 12:36 pm
jgharston wrote: Mon Jul 10, 2023 12:22 pm So, tokenise into Russell format, and then convert to Acorn format
Yes, that is trivial enough.
Does anyone else use BBC Basic for Windows or for SDL and convert for the BBC?
Me! :) Especially with BeebEm using VDFS with "Translate BASIC files" turned on.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
markusher
Posts: 345
Joined: Tue Jul 17, 2018 10:55 am
Contact:

Re: Flexible BASIC Lister for Windows

Post by markusher »

I've also been using it recently. De-tokenising and editing the file was easy enough, but having an automated path back to tokenised and in the emulator environment was something of a sticking point.
-Mark
2 x BBC, 1 Viglen BBC, M128, M512, M128+copro, 1 Master ET, BBC AIV Domesday System, E01S, E01, E20 Filestore, 3 x A4000, RISC PC 600,700, StrongArm. Probably more I've missed and all sorts of bits and pieces.
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

Hi guys, I haven't died! Just very busy, with two deadlines to meet. I thought I'd get BasList posted, knowing this was coming up and I wouldn't have time later, and it was part of my procrastination routine. Most of the stuff I get done is because I have a deadline for something more important looming, so don't knock it.

So now I have requests/suggestions for BasList on other platforms, a re-tokenisation command and a BBC-Russel conversion routine. I have also been introduced to the idea of VDFS, which looks a very promising way of swapping between an emulator and native host without the faff -- so much to learn!

And that's before the ideas of my own, like updating BasList to open files with a certain extension, say, .BBAS, convert to text, save in %temp% and open in Notepad++ or editor of your choice. Or installing a Shell Archive Provider that can read DFS and ADFS images, and opens them in Windows File Explorer just like it does Zip files today, probably with automatic detokenisation and tokenisation on opening and closing.

But I'm pretty thronged until September, so I have to be realistic. I have installed VS Code, thinking it would be a quick win for the cross-platform situation. Takes some getting used to! I attach the source for BasList in case anyone gets inspired before I have time.
Attachments
Baslist.zip
Visual Studio 2022 C#
(1.07 MiB) Downloaded 19 times
User avatar
andrew_rowland
Posts: 44
Joined: Sun Sep 13, 2009 8:06 pm
Location: Holmes Chapel, Crewe, Cheshire
Contact:

Re: Flexible BASIC Lister for Windows

Post by andrew_rowland »

I have updated the installer to create three batch files in the SendTo directory. Now all you have to do is right-click an Acorn program file and point to Send to > Baslist.bat (or BaslistN.bat or BaslistV.bat for numbers and Basic V respectively). It will create a listing as a .bas file in the same folder -- all without hitting the command line. Way simpler than some of the other ideas I had had!
Link still https://www.goggleboxtech.uk/rowlandsof ... php?id=998
BasList itself remains unaltered. Hope to create versions for other platforms soon.
Post Reply

Return to “development tools”