Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
--base-string=1 issue (* solved *)
#1
Hi guys,

It's been a while but I recently started trying to convert a program written in 'standard' Sinclair BASIC so that it would compile with ZX Basic. It's going fairly well, but I've come across a problem with the --base-string option in release 1.5.3.

Take a look at this short program, which is supposed to replace 'character 1' in a string:

Code:
dim st as string

cls
let st="test"
print st(1)
let st(1)="X"
print st(1)
print st

If I compile this with --base-string=0 then the result is 'e/X/tXst', as I would expect.

However, if I compile with --base-string=1 then the result is 't/t/tXst' rather than 't/X/Xest'. It seems the read of char '1' respects the setting, but the write does not.

I've been having some pretty weird crash errors that look like memory being randomly overwritten - wondering if maybe this might have something to do with it (fingers crossed).

Thanks in advance for anything you can do to help! Smile
Reply
#2
Yes, I've tested it and I can confirm it's a bug. :oops:
I'm working to fix it.
Reply
#3
Thanks, boriel - much obliged. Smile

Usually this wouldn't be a problem because I would be writing for ZX Basic, but in this case it's a listing written for Spectrum BASIC first so all the alignments are 1-based rather than zero.
Reply
#4
Okay, i think it is fixed.

Can you check version 1.6.2 and tell me if it works ok, please? :roll:
Reply
#5
Okay, first the good news - the 'base=1' string handling seems to work great now, many thanks! Smile

Now the bad news... there's something weird going on when I perform calculations on memory pointers.

Edit: moved this out into a separate bug report.
Reply
#6
This should be asked in a new question :roll:
Can you please start a new bug question? (I can split this post for you, if you like) :wink:
Reply
#7
Oops, of course - sorry! I've split it out, so you can set this one to solved now.
Reply
#8
LTee Wrote:Oops, of course - sorry! I've split it out, so you can set this one to solved now.
Thanks! :roll:
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)