Number too big

Here you can talk about anything related to BBC BASIC, not covered in another category
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Number too big

Post by Ric »

I have a program running on my laptop in BBCsdl, but when I transfer it to my phone I get the error "number too big"
That is inconvenient, but is there a way of finding the line at which the error occurs. The program has line numbers.

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Number too big

Post by Ric »

After much messing about with trying to make the programm "mistake" it is this line
ssHead% = FN_imgLoad(@usr$ + "ssHead.png")
that the problem occurs.

yes the file ssHead.png is in the file @usr$

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: Number too big

Post by Richard Russell »

Ric wrote: Thu 23 Jan 2025, 20:25 is there a way of finding the line at which the error occurs. The program has line numbers.
The line number at which an error occurs can be found in ERL.
After much messing about with trying to make the programm "mistake" it is this line
ssHead% = FN_imgLoad(@usr$ + "ssHead.png")
The documentation of the FN_imgLoad() function is quite explicit:

"The value returned is used to refer to the image subsequently, it must be stored in a 64-bit (%% suffix) or variant (no suffix) variable".

Ignore the documentation at your peril! :o
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Number too big

Post by Ric »

Thankyou Richard,
rather annoyingly i tried running the program a few times and it only fails occasionally, i assume that the pointer is stored can have a value of less than &FFFFFFFF and if so, the program runs.
Ill try the ERL later when i get home. :)
Kind Regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Number too big

Post by Ric »

Thankyou for the "ERL" nudge, I now have ON ERROR blah blah PRINT REPORT$+" at line "+STR$(ERL) and this works a treat.

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023