Command abbreviations under RO3

discuss general risc os software applications and utilities
Related forum: adventures


Post Reply
Boydie
Posts: 767
Joined: Sat Oct 24, 2015 9:25 am
Location: Sunny Wigan
Contact:

Command abbreviations under RO3

Post by Boydie »

I've been trying to get my old software from BITD working both on real machines and emulators, and I've noticed something bizarre.

Under RO2 (at least in an emulator), things work fine.

Under RO3 (both emulator and real machines), I sometimes get the error "Bad file name 'Net:%Logon'".

After much trial and error, I've realised that this happens if file commands are abbreviated.
So, under RO2 "*L.<filename>", "*LO.<Filename>", and "*LOAD <filename>" all work. Under RO3, only *LOAD works; the abbreviated forms generate the error.
It happens after a clean boot, on any file. So it's not program-specific.

Is this a recognised phenomenon? Is there an easy workaround?
User avatar
SKS1
Posts: 324
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: Command abbreviations under RO3

Post by SKS1 »

Someone decided to make the alias search handle abbreviated commands in the early days (can't remember whether Arthur was afflicted); bad move IMO.

RISC OS 3 set up more aliases than RISC OS 2.

You could Unset alias$Logon
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
Boydie
Posts: 767
Joined: Sat Oct 24, 2015 9:25 am
Location: Sunny Wigan
Contact:

Re: Command abbreviations under RO3

Post by Boydie »

Thank you!

You have no idea how much grief that issue's caused me this year (or how much work I now have ahead of me, putting "incompatible" software on multiple machines).
Wish I'd asked sooner!
User avatar
jgharston
Posts: 5319
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Command abbreviations under RO3

Post by jgharston »

You should never ever ever ever ever ever ever ever ever ever ever ever ever ever embed abbreviations into released code, as you have ZERO knowledge of the OTHER PERSON'S machine that it will be run on. On your machine *D. may match DUMP, on my machine *D. may match DESTROY.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
IanJeffray
Posts: 5961
Joined: Sat Jun 06, 2020 3:50 pm
Contact:

Re: Command abbreviations under RO3

Post by IanJeffray »

jgharston wrote: Sat Oct 14, 2023 1:55 pm You should never ever ever ever ever ever ever ever ever ever ever ever ever ever embed abbreviations into released code
Agree. Moreover, it may be arguable to use *%LOAD rather than just *LOAD so that you guarantee to bypass any Alias$
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Command abbreviations under RO3

Post by sirbod »

Boydie wrote: Sat Oct 14, 2023 10:02 am Is there an easy workaround?

Code: Select all

*Set Alias$L. LOAD %*0
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Command abbreviations under RO3

Post by BeebMaster »

I would definitely concur that using minimum command abbreviations should be avoided for any code that might find its way onto a different machine. The only real case for it would be if there is just simply insufficient memory for the code without using an abbreviation. That really ought never to happen on an Archimedes, but could happen on Beebs.

Is this an appropriate place to vent a long-standing gripe of mine: why on Earth did Acorn replace "*I AM" with "*LOGON" in RISC OS?
Image
wiggy
Posts: 507
Joined: Fri Feb 12, 2021 12:19 pm
Contact:

Re: Command abbreviations under RO3

Post by wiggy »

BeebMaster wrote: Tue Oct 17, 2023 5:30 pm why on Earth did Acorn replace "*I AM" with "*LOGON" in RISC OS?
Most of the command parsing and matching under RO is done by the OS itself (the module provides a table of commands, help strings, entry points, etc, and the OS does all the hard work), so the space in the middle breaks the system. The command would have to be just "*I" - which would then screw up the automated output of the *Help tables.

That said, the RO3 PRMs note that NetFS intercepts the Unknown Command service call to implement commands that are server-side, so it might have been possible to "special case" this one although it would be missing from the help.
Post Reply

Return to “32-bit acorn software: other”