The future of 'BBC BASIC for Windows'

Here you can talk about anything related to BBC BASIC, not covered in another category
User avatar
hellomike
Posts: 192
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: The future of 'BBC BASIC for Windows'

Post by hellomike »

The error is solved.... or, rather gone.
It seems to have gone as soon as I changed SYS calls using ANSI versions. So: "CharUpperBuffA", "CompareStringA" and others.

The cause was probably recursive error handler being called in this function.

Code: Select all

14600 DEF FNlibPLFldNum(fld$)
14610 IF fld$=="0":=0
14620 LOCAL fld%,u$
14630
14640 ON ERROR LOCAL PROClibMsgBox("veldnaam '"+fld$+"' is onbekend.",2) : END
14650
14660 fld%=VALfld$
14670 IF fld%>__PLflds% PROClibMsgBox("veld #"+fld$+" bestaat niet.",2) : END
14680 IF fld%==0 THEN
14690   u$=FNlibUpper(fld$)
14700   fld%=EVAL("`"+u$)
14710   IF u$<fld$ fld%=-fld%:REM Veldnaam bevatte kleine letters
14720 ELSE
14730   fld%+=SGN(fld%)*10000:REM Indicatie dat een veldnr (ipv naam) is gebruikt
14740 ENDIF
14750 =fld%
I.e. a LOCAL error handler keep getting called starting in line 14690. The FNlibUpper() was using SYS "CharUpperBuff" and PROClibMsgBox() used SYS "MessageBox" which BBCSDL also didn't like......

That would eventually throw a No Room, right?

Mike
Hated Moron

Re: The future of 'BBC BASIC for Windows'

Post by Hated Moron »

hellomike wrote: Wed 23 Aug 2023, 18:22 That would eventually throw a No Room, right?
A recursive error handler could eventually use up all the stack, yes, but I would have expected that to be fairly obvious in a TRACE listing because you would see the same small group of line numbers repeated over-and-over again.

In the case of a catch-all error handler, which is in any case going to quit the program, you can protect yourself from such a situation by using this kind of construct:

Code: Select all

      ON ERROR ON ERROR OFF : PROChandle_error : END
Now, if an error occurs in the error handler it will use the default reporting mechanism. Of course that's not guaranteed to report the error 'visibly', although untrapped errors do take measures to make that more likely; for example this code does report the error even though you might not expect it to:

Code: Select all

      *OUTPUT 15
      *REFRESH OFF
      PRINT 1/0
Hated Moron

Re: The future of 'BBC BASIC for Windows'

Post by Hated Moron »

DDRM wrote: Sat 05 Aug 2023, 20:41 As I said in a PM, I'll have a look at one or more of the Winlib libraries over the next month or so, and see if I can make some progress.
Nearly three months on, I feel that means "the next month or so" has elapsed. Can we have a progress report please?
DDRM

Re: The future of 'BBC BASIC for Windows'

Post by DDRM »

Didn't happen, now drowning in coursework again...

:-(

D
Hated Moron

Re: The future of 'BBC BASIC for Windows'

Post by Hated Moron »

DDRM wrote: Wed 01 Nov 2023, 09:16 Didn't happen, now drowning in coursework again...
A bit more information would be helpful, not least whether you still intend to attempt it when you have the time. Or if not, what has changed your mind. Something more positive would be greatly appreciated!
DDRM

Re: The future of 'BBC BASIC for Windows'

Post by DDRM »

In principle I'm keen: I'd love to make it easier for BBC-SDL to be used to make "native-looking" Windows apps. In practice, I'm effectively doing a taught Masters at the moment, and it keeps me pretty busy...

Best wishes,

D
Hated Moron

Re: The future of 'BBC BASIC for Windows'

Post by Hated Moron »

DDRM wrote: Thu 02 Nov 2023, 09:08 In principle I'm keen: I'd love to make it easier for BBC-SDL to be used to make "native-looking" Windows apps. In practice, I'm effectively doing a taught Masters at the moment, and it keeps me pretty busy...
In one sense there's no rush, since nobody thinks Windows is going to drop support for 32-bit apps anytime soon, and until it does BBC BASIC for Windows can be used fairly satisfactorily, albeit largely unsupported.

But in another sense there is some urgency, because I strongly suspect it's going to need input from me to resolve some of the difficulties in porting the WINLIB libraries to BBCSDL, and my ability to help is deteriorating worryingly quickly. :cry: