Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5457
| From | Martin <News03@avisoft.f9.co.uk> |
|---|---|
| Subject | Re: Filetype list |
| Newsgroups | comp.sys.acorn.programmer |
| Date | 2018-05-01 10:47 +0100 |
| Message-ID | <56f14f2850News03@avisoft.f9.co.uk> (permalink) |
| References | <6a1b8ef056.harriet@blueyonder.co.uk> <e2af42f156.Matthew@sinenomine.freeserve.co.uk> |
| Organization | None |
On 01 May in article <e2af42f156.Matthew@sinenomine.freeserve.co.uk>,
Matthew Phillips <spam2011m@yahoo.co.uk> wrote:
> In message <6a1b8ef056.harriet@blueyonder.co.uk>
> on 29 Apr 2018 Harriet Bazley wrote:
> > I've been trying to find out why Textseek's code to generate a list
> > of all available filetypes is crashing on the ARMiniX.
> I find the documentation of OS_ReadVarVal on page 1-309 of the PRM to
> be particularly bad. It is not at all clear how you are meant to tell
> you have read all the variables in the wildcarded case.
I agree totally - it is very confusing.
> The trouble is that the SWI documentation exhorts you to find the
> length of the variable value first by setting bit 31 of R2 on entry,
> and then says that "you may get an error on exit, which you should
> ignore". I don't know how you are meant to tell the difference between
> the error that terminates the loop and a random error that may occur
> when testing the length.
I have had a quick look at the code for the *Show command, and it seems
to use the error numbers to differentiate:
&124 = System variable ??? not found
&1E4 = Buffer overflow
At the end of a wildcarded list you receive error &124, and r3 is set to
zero, so either should be usable to end enumeration.
If the buffer is too small (and that includes when the r2 is negative on
entry) you receive error &1E4.
> So it's certainly possible to have zero bytes returned for the length
> in R2.
That is returned (without error) if the value is null.
Null values should either be included in the count or the menu, or
excluded from both. As long as they are the same!
> A pointer to the variable name is returned in R3. The PRM does not
> state whether the name in R3 is null-terminated or just
> control-character terminated.
It seems to be null-terminated.
Martin
--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Filetype list Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-04-29 23:38 +0100
Re: Filetype list Martin <News03@avisoft.f9.co.uk> - 2018-04-30 10:54 +0100
Re: Filetype list Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-04-30 23:43 +0100
Re: Filetype list tk@cestriant.plus.com - 2018-04-30 15:12 +0100
Re: Filetype list Matthew Phillips <spam2011m@yahoo.co.uk> - 2018-05-01 08:31 +0100
Re: Filetype list Martin <News03@avisoft.f9.co.uk> - 2018-05-01 10:47 +0100
Re: Filetype list Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-05-07 23:21 +0100
Re: Filetype list Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-05-07 23:37 +0100
csiph-web