[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: StrongHelp crashes on launch



The following bytes were arranged on 17 Dec 2015 by Martin :

> In article <98ff6c3355.fjgraute@xxxxxxxxx>,
>    Fred Graute <fjgraute@xxxxxxxxx> wrote:
> > In message <ccf85d3355.martin@xxxxxxxxxxxxxxxx>
> >           Martin Bazley <martin.bazley@xxxxxxxxxxxxxxxx> wrote:
>
> [Snip]
>
> > The problem, as I remember, was how to handle all the old 26-bit !Pre's
> > that are out there. Possibly scan the code before execution and raise a
> > warning when we're on a 32-bit machine and !Pre isn't 32-bit?
>
> That would be neat ... if it is practical to do.
> If warned I would have fixed the Reporter !Pre a decade ago!

If I may make a suggestion here, the use of machine code to perform
simple string manipulation seems unnecessary in this day and age
(arguably in any day and age).  Would it be practical to deprecate the
!Pre file entirely and replace it with something else, say "!Pre2",
which takes its arguments in a more portable way?

There wouldn't be that much extra overhead, considering it's only called
once per manual.  I suppose the main problem would be working out some
way to pass the arguments back, particularly one that wouldn't break in
a multi-core scenario.

The standard SWI !Pre could be much more maintainably expressed in a
form such as the following:

IF LEFT$(input$,1)="X" input$=MID$(input$,2)
SYS "XOS_ReadUnsigned",,input$ TO ,,value%;flags%
IF (flags% AND 1)=0 SYS "OS_SWINumberToString",value% AND NOT &20000,STRING$(255,CHR$13),255 TO ,input$

...And of course I got the undefined instruction error every time I
tried to look up the documentation for the SWIs in that code snippet.

> > As David has already pointed out the latest OS, Toolbox and Wimp manuals
> > come with a 32-bit okay !Pre, but several other manuals don't.
>
> Yes, it seems the same apart from the restore registers flag.
> If Harriet and/or Martin B can verify that it resolves the problem, then
> I will make sure the Reporter manual is fixed for future releases.

The OS manual here has a 21 May 2003 !Pre without the dodgy
flag-setting, but this doesn't fix the search problem as such because
StrongHelp still searches in manuals that contain the old version prior
to reaching the correct one.

[snip]

> > > Two puzzling things about this particular case remain.  The first is
> > > why Reporter's manual would ever need to contain a program which, in
> > > its entirety, strips a leading "X" off the input string and then
> > > pushes it through OS_SWINumberToString if it is numeric.
>
> > To allow the lookup of Reporter's SWIs, even when started with 'X' or
> > specified in numeric form.
>
> Correct.

Ah right, I forgot Reporter had SWIs.

> > > The second is why, when launching a manual on startup, StrongHelp has
> > > seemingly taken to running its !Pre file.  Surely there cannot, by
> > > definition, be any "search string" to analyse here?  The earlier
> > > search problem affected all manuals, as they all needed to be
> > > searched (and hence !Pre-ed) to find the string, but here StrongHelp
> > > is demonstrably running exactly one !Pre file (if present).
> > > Furthermore, it does not appear to do it if the manual is launched
> > > after, rather than before, the application.
>
> > Good questions but no answers yet, I need to do some digging to find out
> > when exactly !Pre is being called.
>
> Seems we have an error each!

The interesting thing is that Martin A has discovered the "search
string" in this scenario is apparently "!Root", which is clearly a bug.
It can't even be intended behaviour to allow manuals to transparently
redirect their home page to something different, because !Pre isn't
executed under all circumstances.

-- 
  __<^>__   Red sky in the morning: Shepherd's warning
 / _   _ \  Red sky at night: Shepherd's delight
( ( |_| ) ) Mince and potatoes: Shepherd's pie
 \_>   <_/  ======================= Martin Bazley ==========================

--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx
List archives at http://www.Torrens.org.uk/RO/StrongED/index.html