BBC Micro Utilities for Windows

Here you can talk about anything related to BBC BASIC, not covered in another category
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

It simply outputs the text exactly as it is. The driver for me was rendering it in a human-readable form. I'm going to switch the default indent style to your preference (which I actually like better anyway) and reverse the switch so that anyone who wants BASIC I and BASIC II nostalgia can be happy :-)
User avatar
JeremyNicoll
Posts: 72
Joined: Sun 26 Jul 2020, 22:22
Location: Edinburgh

Re: BBC Micro Utilities for Windows

Post by JeremyNicoll »

Hated Moron wrote: Wed 05 Apr 2023, 21:24 As we were discussing indentation, I wondered which indentation style it would use for a plain-text program. Although the most likely source of such a file would be Brandy, as it saves programs that way by default, all versions of BBC BASIC can export in plain text as an option (either using an IDE menu option or *spool).
Isn't plain text format also a requirement for anyone who chooses to keep their program source in CVS or git or some similar system?
User avatar
JeremyNicoll
Posts: 72
Joined: Sun 26 Jul 2020, 22:22
Location: Edinburgh

Re: BBC Micro Utilities for Windows

Post by JeremyNicoll »

JeremyNicoll wrote: Wed 05 Apr 2023, 22:21 Isn't plain text format also a requirement for anyone who chooses to keep their program source in CVS or git or some similar system?
Oops, meant to add: and also it enables

- use of conventional file diffing utilities (to say nothing of sophisticated ones aimed mainly at programmers); for example I
use Prestosoft's ExamDiff Pro...

- generation/manipulation of program source by other programming languages. For example a while ago I considered writing
a system that could use a sort of plug-in architecture of extra sets of functions & procedures written by third parties; the
runtime logic for that had to accomodate same-named functions/procedures & global variables provided by different plug-in
authors. The way I thought I would do it was to have them provide code in plain text form (written to standards I'd define &
enforce) and as my runtime system loaded them it'd rename all of the functions/procedures/global vars on the fly keeping
track of which set were in which logical plugin.
User avatar
JeremyNicoll
Posts: 72
Joined: Sun 26 Jul 2020, 22:22
Location: Edinburgh

Re: BBC Micro Utilities for Windows

Post by JeremyNicoll »

JeremyNicoll wrote: Wed 05 Apr 2023, 22:30
JeremyNicoll wrote: Wed 05 Apr 2023, 22:21 Isn't plain text format also a requirement for anyone who chooses to keep their program source in CVS or git or some similar system?
Oops, meant to add: and also it enables

- use of conventional file diffing utilities (to say nothing of sophisticated ones aimed mainly at programmers); for example I
use Prestosoft's ExamDiff Pro...

- generation/manipulation of program source by other programming languages. For example a while ago I considered writing
a system that could use a sort of plug-in architecture of extra sets of functions & procedures written by third parties; the
runtime logic for that had to accomodate same-named functions/procedures & global variables [edit: global/common to their
specific set of functions/procedures, not global to the overall system - I aimed to provided those, some R/O, some R/W]
provided by different plug-in authors. The way I thought I would do it was to have them provide code in plain text form
(written to standards I'd define & enforce at plugin-load time) and as my runtime system loaded them it'd rename all of the
functions/procedures/global vars on the fly keeping track of which set were in which logical plugin.
User avatar
JeremyNicoll
Posts: 72
Joined: Sun 26 Jul 2020, 22:22
Location: Edinburgh

Re: BBC Micro Utilities for Windows

Post by JeremyNicoll »

KaraTheValkyrie wrote: Tue 04 Apr 2023, 20:58 The 1.0.30 version is at

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

and the detached PGP signature is

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

iQFNBAABCAA3FiEEbRotVTbNBS5QuWqPWV58wKNDrqoFAmQrvUcZHGthcmFvdHRl
d2VsbEBvdXRsb29rLmNvbQAKCRBZXnzAo0OuqkSvB/9nuhW/mGczT2JCvSRsua4j
riuZq6J0CD/d/3vhouU0KfPc+/KjgM4f49iTC/kZeHILvcEpRC0KNAyzPDg5fUoW
1y87wDbLtm/ylp7bWBRjeoLo6UK3sEX7WSvrLlN0lu/R6wBGc2i7Bq6cj2b6KiB+
HVk2dNkKCHLcUUQJFsaPYTq3UmPjOG4mA2x8xST82riBEWIw005EPVGdzREAyhfm
7VxCE2MboVzD/UdMrrxBqK/37aP+r0xXAKRWogw1wyX1jNDZpEQFgSnL3yWm4m4B
vQ4JOcCbfMDG+iMOwbGsa1OobUcEN+jcRKCkoaSFOELUosjCos3nqzBoEoMlkGB5
=6j8V
-----END PGP SIGNATURE-----

Cheers

Kara
I've no idea what I'd do with the PGP signature (on a forum post) though I do in theory know how they work with emails ... but I don't bother with them there either.

However more to the point I see that your link (to what may not now be the most recent version of your utility - or maybe it's a set of utilities?) - only links to an .msi and a setup.exe. These days I'm reluctant to use either, when - surely - these utilities should be able to be presented in a "portable" form? I peeked into both the msi and setup.exe using 7-zip and in neither case did I just see a set of .exe's that could be run from a terminal window. Why not, if all it/they do is read a basic program and generate a file showing a representation of it? And what do the other (if there are others) utilities do?
User avatar
KaraTheValkyrie
Posts: 12
Joined: Sat 14 Jan 2023, 19:29

Re: BBC Micro Utilities for Windows

Post by KaraTheValkyrie »

The detached signature is for those who want to make sure that the file hasn't been tampered with and is what I posted. You'd need to use something like GPG (https://www.gnupg.org/download/) to verify - you can ignore it and just virus-check the file if you would still like some reassurance.

Just download the .zip file, double-click to expand it, then double-click on the setup.exe and it will open the installer. Follow the prompts, and it will install the programs in C:\Program Files\KOCode\BBC Micro Utilities\ (assuming that your system disk is C:) and add that to your %PATH%, so that you can invoke the commands from a command window. So if you open a command window and issue the where command, you'll see this:
Microsoft Windows [Version 10.0.22624.1537]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Kara>where bbcbasictotext
C:\Program Files\KOCode\BBC Micro Utilities\BBCBasicToText.exe

C:\Users\Kara>
Obviously your command prompt will be slightly different.

You can indeed just copy the contents to a folder of your choosing (in fact the installer will let you specify that). The .exes are the programs, BBCBasicToText, BBCDataFileToText, and BBCReadDiskImage, the .dll files are the associated dynamic link libraries, the .json is just config for the .Net6.0 framework, and the .pdb files are the program database files for if you want to attach a debugger. My plan is to submit them to the Windows Store so that they can be verified and signed by Microsoft, and released and updated from there at some future time, so for that I created a release package with the installer and .MSI which contains the files. The AddToPATH.exe is a custom action which, as the name suggests, adds the location to the %PATH% variable.

I'll update the first post with the latest version, 1.0.40, which has the default indentation to keep HM happy :-)
https://img1.wsimg.com/blobby/go/8ec357 ... 0760112625

If you just want to get the files, then copy the .MSI from the ,zip file, then use msiexec to extract the individual files, e.g. something like
msiexec /a "BBC Micro Utilities.msi" /qb TARGETDIR=c:\temp\test
Here's the help output from each of the tools:

BBCBasicToText [options] source [destination]

Description:
  The BBC BASIC to Text tool converts tokenized BBC BASIC files to plain text, BBCode, or HTML.

  source       Specify the input file to be converted. Wildcards can be used. Input .txt or .html files are ignored.

  destination  Optionally specify the output file, or console if omitted. A .html or .htm destination file produces HMTL output,
               .bbcode produces BBCode, else it is plain text. All but plain text highlight different entities in color.

  --acorn-basic2-indent            Use BBC BASIC 1 and 2 style indentation for FOR, REPEAT, WHILE, and CASE.
   /a or -a                        Default is BBC BASIC for Windows style where the loop end is still indented.

  --noescape                       Do not escape non-printable characters, keep as binary unless output is console. Escaped
   /b or -b                        characters are displayed as " xx" where xx are the two hexadecimal digits, e.g. " 7F" .

  --exclude=substr1[,substr2...]   For wildcard input source files, exclude matches with specified substring(s).
                                   Use commas to separate substrings, e.g. --exclude=.INF,.TXT

  --force                          Force overwriting of existing output files WITHOUT PROMPTING. Use with care!
                                   Default prompt-before-overwrite lets you specify the first letter of Yes/No/All.

  --noindent                       No auto-indentation for FOR, REPEAT, WHILE, CASE. Default is a two character indent per level.
   /n or -n

  --open-in-browser                Open all the output files in a browser window.
   /o or -o

  --recursive                      For wildcard input source file specifications, recurse into subfolders.
   /r or -r

  --suppress-line-numbers          Suppress the line numbers at the start of each line.
   /s or -s

  --help                           Display this help.

BBCDataFileToText [options] source [destination]

Description:
  The BBC Data File to Text tool converts data files, written by BBC BASIC's PRINT#, to plain text, BBCode, or HTML.

  source       Specify the input file to be converted. Wildcards can be used. Input .txt or .html files are ignored.

  destination  Optionally specify the output file, or console if omitted. A .html or .htm destination file produces HMTL output,
               .bbcode produces BBCode, else it is plain text. All but plain text highlight different entities in color.

  --ascii                          Do a dump of the file showing nonprintable characters as hex, else as characters.


  --data                           Force file to be treated as valid data. Useful if partial or corrupted,
                                   but can cause garbage to be printed as data.

  --noescape                       Do not escape non-printable characters, keep as binary unless output is console. Escaped
   /b or -b                        characters are displayed as " xx" where xx are the two hexadecimal digits, e.g. " 7F" .

  --exclude=substr1[,substr2...]   For wildcard input source files, exclude matches with specified substring(s).
                                   Use commas to separate substrings, e.g. --exclude=.INF,.TXT

  --force                          Force overwriting of existing output files WITHOUT PROMPTING. Use with care!
                                   Default prompt-before-overwrite lets you specify the first letter of Yes/No/All

  --hex                            Do a hex dump of the file
   /x

  --noindent                       No auto-indentation for FOR, REPEAT, WHILE, CASE. Default is a two character indent per level.
   /n or -n

  --open-in-browser                Open all the output files in a browser window.
   /o or -o

  --recursive                      For wildcard input source file specifications, recurse into subfolders.
   /r or -r

  --suppress-line-numbers          Suppress the line numbers at the start of each line.
   /s or -s

  --help                           Display this help.

BBCReadDiskImage [options] source [destination]

Description:
  This reads .dsd and .ssd BBC Micro disk images, gives catalog and file information, in plain text, BBCode, or HTML.
  It can dump the entire image as escaped byte values, and allows export of all, or specific, files from the image.

  source       Specify the disk image input file. Wildcards can be used

  destination  Optionally specify the output file, or console if omitted. A .html or .htm destination file produces HMTL output,
               .bbcode produces BBCode, else it is plain text. All but plain text highlight different entities in color.

  --catalog                        Dump the catalog blocks in the first two sectors, in hex.
   /c or -c

  --directory=d1[,d2...]           Specify the directory letter to look in on the disk image. Default is all directories.

  --exclude=substr1[,substr2...]   Exclude source file matches containig the specified substring(s). You can use * and
                                   ? wildcards. Use commas to separate substrings, e.g. --exclude=.INF,.TXT

  --export=file1[,file2...]        Specify the file, or files, to export from the disk image. You can use * and ?
                                   wildcards. Use commas to separate substrings, e.g. --export=!BOOT,MYPROG*

  --force                          Force overwriting of existing output files WITHOUT PROMPTING. Use with care!
                                   Default prompt-before-overwrite lets you specify the first letter of Yes/No/All

  --info                           Give the same information that *INFO would

  --open-in-browser                Open all the output files in a browser window.
   /o or -o

  --recursive                      For wildcard input source file specifications, recurse into subfolders.
   /r or -r

  --search=substr1[,substr2...]    Search disk images for files matching the specified list of string(s). You can use
                                   * and ? wildcards. Use commas to separate substrings, e.g. --search=*graph*,turnip

  --side=<side>                    Specify side 0 or 1, corresponding to disk 0 or disk 2, or the default, * for both.

  --help                           Display this help.
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

JeremyNicoll wrote: Wed 05 Apr 2023, 22:21 Isn't plain text format also a requirement for anyone who chooses to keep their program source in CVS or git or some similar system?
A Git repository can contain binary files, of course (and you can always use .gitattributes to force it to treat a .bbc file as binary), but to benefit from the source-control features rather than simply using it as an archive I expect you're right.

Certainly both the BB4W and BBCSDL IDEs will work with plain-text program files quite happily, and if the program was loaded from a plain-text file it will be saved to a plain-text file by default too. I know that some users choose to do that all the time.

The only circumstances in my BASICs when you're forced to use a tokenised file are when it is loaded with a CALL, CHAIN or INSTALL statement. For speed they load the file directly into memory, without any parsing or tokenising or anything.
Hated Moron

Re: BBC Micro Utilities for Windows

Post by Hated Moron »

hellomike wrote: Thu 30 Mar 2023, 09:11 I then tried the same using SDLIDE 1.34a. The sound is equally similar however the Owl is drawn like a checkerboard. Not sure why.
That is fixed in v1.35a, thank you for drawing it to my attention. For future reference, the best place to report a bug in BBC BASIC for SDL 2.0 is probably the Issues section of the GitHub repository.

Curiously, however, it still doesn't work properly on my Asus Chromebook. That appears to be a bug in the Chrome OS emulation of Android, and outside my control.