05-20-2009, 09:58 PM
britlion Wrote:Erm. Um. :?:
Okay. Hopefully you can grab this file: <!-- m --><a class="postlink" href="http://britlion.googlepages.com/test.tzx">http://britlion.googlepages.com/test.tzx</a><!-- m -->
Is this working on your emulator? Because in Spectaculator 7.00 it loads, scrolls for a few seconds, and crashes!
This file effectively crashes. However, are you sure this file is the compilation of the above Source Code? It seems it is not.
The way it crashed might suggest a Stack Overflow. Are you using GOSUB or function calls in that code?
Update:

So I now have something to test.

Update2: Fixed. The problem are lines 70 & 80. They should read:
Code:
70 IF fin>=LEN a$ THEN LET fin=0 : END IF
80 IF start>=LEN a$ THEN LET start=0 : END IF
I will put some more checking, but since this will slowdown array/string accesses. I think It could be a good idea to put some compiler option to enable/disable array/strings boundary checks. Once the program is debugged, you can recompile disabling it.
Another fix could be to enable a flag like:
Code:
zxb --string-base=1
Code:
zxb --string-base=1 --array-base=1
Code:
zxb --sinclair
Note: --sinclair already exists, but does not change string-base