BBC Micro Utilities for Windows

Here you can talk about anything related to BBC BASIC, not covered in another category
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

KaraTheValkyrie wrote: Thu 30 Mar 2023, 19:46 I use the same indent as the original BBC Micro, e.g. (copied from Beebem, which is the same)
In BASIC 1 and BASIC 2, yes, but by BASIC 4 (e.g. in the BBC Master) it had been fixed, and all subsequent versions of BBC BASIC - including Sophie's ARM BASIC 5 & 6, all my BASICs and Brandy - indent consistently by aligning the FOR and NEXT, and the same for all the other block constructs. I'm not sure that we should be reincarnating a feature of those very early versions, which had gone by 1984! :)

indent.png
You do not have the required permissions to view the files attached to this post.
User avatar
hellomike
Posts: 184
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: BBC Micro Utilities for Windows

Post by hellomike »

You know very well that I might and will never say nor think such a thing.
Man, the amount of joy I had using your products together with the quick and always helpful support is massive.

You are much more strict to yourself than all of the users combined, I'm sure.

Take care.

Mike
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

I've added the option to use the BBC BASIC for Windows indentation style via the /w or --windows-style-indent switches. I extracted the program using
C:\...\WelcomeDiskFiles\> bbcreaddiskimage Welcome.ssd --export=*welcome*
then used
C:\...\WelcomeDiskFiles\> bbcbasictotext 0_W.WELCOME *.bbcode /w

BBCBasicToText found 1 file matching 0_W.WELCOME
Escape non-printable charaters: True

BBCBasicToText: processing 1/1, C:\Users\karal\OneDrive\Documents\BBCMicro\BeebEm\DiscIms\WelcomeDiskFiles\0_W.WELCOME
BBCBasicToText Success: processed C:\Users\karal\OneDrive\Documents\BBCMicro\BeebEm\DiscIms\WelcomeDiskFiles\0_W.WELCOME
Output: C:\...\WelcomeDiskFiles\0_W.WELCOME.bbcode

BBCBasicToText found and processed 1 file, ignored 0, excluded 0, produced results for 1

Which produced

0_W.WELCOME

BBCBasicToText: processing 1/1, C:\...\WelcomeDiskFiles\0_W.WELCOME
   10  REM New version of 'INTRO' from
   20  REM Welcome pack
...
  450 X1%=XL%:X2%=XL%:X3%=XR%:X4%=XR%:Y1%=YD%:Y2%=YU%:Y3%=YD%:Y4%=YU%
  460 PROCPLOT
  470 FORJ0%=1TOM8
  480   PROCPLOT
  490   X1%=X1%+U1%:X2%=X2%+U1%:X3%=X3%+U2%:X4%=X4%+U2%
  500   Y1%=Y1%+V1%:Y2%=Y2%+V2%:Y3%=Y3%+V1%:Y4%=Y4%+V2%
  510   PROCPLOT
  520 NEXT <--- Windows-style indentation for loop closure
  530 PROCPLOT
  540 ENDPROC
...
BBCBasicToText Success: processed C:\...\WelcomeDiskFiles\0_W.WELCOME
Output: C:\...\WelcomeDiskFiles\0_W.WELCOME.bbcode

BBCBasicToText found and processed 1 file, ignored 0, excluded 0, produced results for 1


Indentation is applied to FOR, REPEAT, WHILE, and CASE. The 1.0.20 version is at

https://img1.wsimg.com/blobby/go/8ec357 ... 0289497292

and the GPG signature is

-----BEGIN PGP SIGNATURE-----

iQFNBAABCAA3FiEEbRotVTbNBS5QuWqPWV58wKNDrqoFAmQnLicZHGthcmFvdHRl
d2VsbEBvdXRsb29rLmNvbQAKCRBZXnzAo0Ouqqp9B/9zKNjGqL7/qQiAydBZVvTz
b8m04KvRXprDTOGI2EQhuufNmUJqI8LKK5clO60yypcSmz8QbAFQgSJNA9efuc3F
sneOWOCpTLMyfGSvaJ3lO+ztnjlddZBe6zVVBVjeWmFl8lforPhBfBi0LQMevjyt
IulMtKmwQPWmWrPVtlquJ6iVpXMP2GHFNCdmmEHNxH8DdcKubWEsgsZ4esnRSTou
0xVy5/mhsbEGkfgHNBasqTP5hhWT26TKSZcxIIEyqkQVsBsxRANr+sSiPLiRQjds
I70s+eOcwGb0qM8W1VulPSf2ETnM3v2Y4IeXYdC9rtVE3v6iuXQBA2poHRjlpiCt
=ZDLj
-----END PGP SIGNATURE-----
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

Are you calling me old? :-) OK, fair enough - I am, and I only have, in physical form, a BBC Micro Model B, so I was enjoying the nostalgia!
The new indent option should work for you. I'll be introducing a config file so that you can default various settings to what you want. Please let me know if you find any bugs in the utilities or have any other suggestions.
Hated Moron wrote: Fri 31 Mar 2023, 09:27
KaraTheValkyrie wrote: Thu 30 Mar 2023, 19:46 I use the same indent as the original BBC Micro, e.g. (copied from Beebem, which is the same)
In BASIC 1 and BASIC 2, yes, but by BASIC 4 (e.g. in the BBC Master) it had been fixed, and all subsequent versions of BBC BASIC - including Sophie's ARM BASIC 5 & 6, all my BASICs and Brandy - indent consistently by aligning the FOR and NEXT, and the same for all the other block constructs. I'm not sure that we should be reincarnating a feature of those very early versions, which had gone by 1984! :)


indent.png
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

KaraTheValkyrie wrote: Fri 31 Mar 2023, 19:46 I only have, in physical form, a BBC Micro Model B, so I was enjoying the nostalgia!
I have to confess I am the exact opposite. I have zero interest in the BBC Micro (or indeed in any Acorn hardware or software product) and 'retro computing' holds no appeal for me at all. :(

This is not meant in any way as a criticism, but I always find it puzzling when I encounter a utility program such as yours written in a language like C or dotNET. Why not BBC BASIC? :?

Having said that, I believe the administrator of this forum also doesn't use BBC BASIC for day-to-day programming tasks. So I increasingly find myself out of step with the forum and its membership.
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

I'm just very familiar with C# and had an eye to publishing it on the Microsoft Store. I wrote it more for use with Beebem originally, and to see what I had on my old floppy disk collection, so I wanted it up and working quickly once I had repaired the power supply on my 41 year-old BBC Micro. But I am adding things like BBCode output support to hopefully help people post code for BBC Basic on these boards. I also play around with Raspberry Pis, so I'll be looking at installing BBC BASIC on there when I get time.
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

KaraTheValkyrie wrote: Sat 01 Apr 2023, 00:07 I'm just very familiar with C# and had an eye to publishing it on the Microsoft Store.
I must admit you've got me there - I can't offer a route for getting a program developed in BBC BASIC into the Microsoft Store.

But that's quite an outlier I would say, generally speaking BBC BASIC provides one of the broadest ranges of supported target platforms of any programming language: Windows (desktop), Linux (including Raspberry Pi), MacOS, Android, iOS and in-browser - even the Raspberry Pi Pico for some applications.

When you factor in support for 2D and 3D graphics, anti-aliased graphics, shader programming, physics simulations, sound, music, video, network access etc. I would suggest that BBC BASIC is probably unrivalled in supporting such a range of platforms without needing any changes to the source program (with care).
I wrote it more for use with Beebem originally, and to see what I had on my old floppy disk collection
I assume you're a member of the StarDot forum. That's where you'll find the main 'market' for your kind of utility; members there are typically far more into the BBC Micro and other Acorn products than those here. Don't mention me or my BASICs at that forum though, I am 'persona non grata' there. :cry:
I _think_ my utility has all the codes for BBC BASIC for Windows, in addition to the original ones
As far as I can recall, the only feature of my BASICs that can impact on indentation, which is not in Acorn's ARM BASIC 5 & 6 and therefore already covered, is the EXIT keyword. If you're not expecting them, EXIT FOR, EXIT REPEAT and EXIT WHILE are likely to cause an indentation change when they shouldn't.
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

Is the token for EXIT just 0x10 or does it have more than one byte encoding for it, and/or do you have different tokens for "EXIT FOR", "EXIT REPEAT" and "EXIT WHILE" or are they just consecutive keyword tokens? Also, what effect, if any, does it have on indentation. I don't currently support EXIT, so I want to add it. And yes, I am on StarDot already.

Thanks!

Kara
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

KaraTheValkyrie wrote: Sat 01 Apr 2023, 19:45 Is the token for EXIT just 0x10
Yes. I have never really understood why Sophie introduced 2-byte tokens, which was a significant complication, when there were plenty of single-byte values still available. I decided not to follow her lead.

The single-byte values available for use as tokens, expressed as a signed number, are -128 (&80) to +31 (&1F) with the exception of +13 (&0D) which is Carriage Return and is used as a line terminator (I chose to reserve NUL too, as it's also often used as a terminator).

So that's a total of 158 possible single-byte tokens, which is enough to cater for all the extensions to BBC BASIC with room to spare. Another four could be made available because the separate 'left' and 'right' tokens for the pseudo-variables PAGE, TIME, LOMEM and HIMEM were never really necessary (you can always determine which it is from the context).

It may be that Sophie felt that even 162 tokens might eventually prove insufficient so introduced 2-byte tokens to be future-proof, but since we've still not come close to exhausting them nearly 40 years later the complication was too high a price to pay in my judgement.
Also, what effect, if any, does it have on indentation.
As I said EXIT FOR, EXIT REPEAT and EXIT WHILE do not affect indentation:

Code: Select all

   10 FOR i = 1 TO 10
   20   PRINT i
   30   IF i = 5 THEN EXIT FOR
   40 NEXT i
DDRM

Re: BBC Micro Utilities for Windows

Post by DDRM »

>Having said that, I believe the administrator of this forum also doesn't use BBC BASIC for day-to-day programming tasks.

Actually, I do! If I just want a quick computational solution to (or visualisation of) something, I nearly always go for BB4W. It's just that for coursework (which as a finalist understandably takes up a lot of my time) I usually HAVE to use other languages (mostly python at the moment for AI-type things...). However, for my cryptography, for example, I usually choose to implement the algorithms in BBC BASIC. I use BB4W because I've got it,but all the code would run equally well in BBC -SDL.

The combination of simple code and quite sophisticated and simple graphical output is one I haven't met in other languages - partly because of the amount of time I've spent writing in BB4W, which makes lots of things feel second nature to me which are still challenging in C/C++/python/Java. I CAN do it in those languages, but it takes me longer. Yes, C will be faster, but not enough to compensate for the extra time it takes me to code it up!

:-)

D