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


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

Basic ERL wrong after abort

From Martin <News03@avisoft.f9.co.uk>
Subject Basic ERL wrong after abort
Newsgroups comp.sys.acorn.programmer
Date 2012-01-07 12:54 +0000
Message-ID <524dd2a9c0News03@avisoft.f9.co.uk> (permalink)
Organization None

Show all headers | View raw


For some time I have been bugged by instances where a Basic program has
encountered an error, but the ERL of the error is always (misleadingly)
set to the very last line of the program (even if that comes from a
LIBRARY).

This, in a large program, can cause far too much time wasted in narrowing
down where the real error actually is.

At last I have managed to create a small program to demonstrate this. I
know it is a stupid thing to write, but it is only to illustrate the
error handling problem. It is...

    10 : REM Abort        Gives ERL as last line of program. Why?
    20 :
    30 : ON ERROR PROCerror
    40 : SYS "Wimp_Initialise",300,&4b534154,"Test abort"
    50 : SYS "Wimp_CreateWindow",,123456789 TO h%  :REM <<error!!
    60 : END
    70 :
    80 : DEF PROCerror
    90 : DIM err% 256
   100 : $(err%+4)= REPORT$ +" ERL="+STR$ERL +" ERR="+STR$~ERR
   110 : SYS "Wimp_ReportError",err%
   120 : END
   130 :
   140 : REM This last line is ERL!

When run it gives an Data Transfer abort with ERL=140, the last line, not
50.

I *think* the only instances I have seen of this have been Aborts, and
may only have been within SWIs (rather than just in assembler code).

Can anyone throw any light on why this happens? 
The more technical, the better!

Thanks
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 | NextNext in thread | Find similar | Unroll thread


Thread

Basic ERL wrong after abort Martin <News03@avisoft.f9.co.uk> - 2012-01-07 12:54 +0000
  Re: Basic ERL wrong after abort cferris@freeRemoveuk.com.invalid - 2012-01-07 13:49 +0000
    Re: Basic ERL wrong after abort Martin <News03@avisoft.f9.co.uk> - 2012-01-07 15:22 +0000
  Re: Basic ERL wrong after abort Gerph <gerph@gerph.org> - 2012-01-07 06:11 -0800
    Re: Basic ERL wrong after abort Martin <News03@avisoft.f9.co.uk> - 2012-01-07 17:56 +0000
      Re: Basic ERL wrong after abort wpb <w.blatchley@yahoo.com> - 2012-01-08 04:05 -0800
        Re: Basic ERL wrong after abort Martin <News03@avisoft.f9.co.uk> - 2013-05-19 17:42 +0100
          Re: Basic ERL wrong after abort Alan Adams <alan@adamshome.org.uk> - 2013-05-19 18:42 +0100

csiph-web