Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5452

Filetype list

From Harriet Bazley <harriet@bazleyfamily.co.uk>
Newsgroups comp.sys.acorn.programmer
Subject Filetype list
Message-ID <6a1b8ef056.harriet@blueyonder.co.uk> (permalink)
Organization virginmedia.com
Date 2018-04-29 23:38 +0100

Show all headers | View raw


I've been trying to find out why Textseek's code to generate a list of all
available filetypes is crashing on the ARMiniX.

What I've currently got is an attempt to measure the number of filetypes

DEF FNcountfiletypes
LOCAL ptr%,n%,err%
REPEAT
n%+=1
SYS"XOS_ReadVarVal","File$Type_*",wimp%,255,ptr% TO ,,,ptr%;err%
UNTIL err% AND 1
=n%-1

in order to dimension the various menu blocks correctly, followed by

REPEAT
  SYS"XOS_ReadVarVal","File$Type_*",block%,255,ptr% TO ,,bytes%,ptr%;err%
  IF bytes% THEN
    block%?bytes%=13
    $textptr%=FNs(block%)
    $(textptr%+10)=FNs(ptr%+10)
    textptr%+=14
  ENDIF
UNTIL bytes%=0

Apparently on the new machine it's possible for OSReadVarVal to return R2=0
without having reached the end of the wildcarded list, and without
generating an error.   So even if I change the terminating condition to
check for an error from the XOS call, I still have the problem that
FNcountfiletypes is returning too high a value on account of the random null
values being skipped over in the middle of the loop, and that I thus have
rubbish menu entries at the end of the list filled with undefined data.

Has this SWI changed in later versions of the OS?   (This code was written
for RISC OS 3.1), and quite probably copied out of someone else's PD
application in the first place....

-- 
Harriet Bazley                     ==  Loyaulte me lie ==

We prefer to speak evil of ourselves than not speak of ourselves at all.

Back to comp.sys.acorn.programmer | Previous | NextNext in thread | Find similar | Unroll thread


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