FAQ  •  Register  •  Login

--base-string=1 issue (* solved *)

<<

LTee

Posts: 153

Joined: Tue Jul 07, 2009 2:54 pm

Post Mon Jun 19, 2017 7:21 pm

--base-string=1 issue (* solved *)

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! :)
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Jun 21, 2017 12:43 pm

Re: --base-string=1 issue

Yes, I've tested it and I can confirm it's a bug. :oops:
I'm working to fix it.
<<

LTee

Posts: 153

Joined: Tue Jul 07, 2009 2:54 pm

Post Thu Jun 22, 2017 8:35 pm

Re: --base-string=1 issue

Thanks, boriel - much obliged. :)

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.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Jun 23, 2017 11:28 pm

Re: --base-string=1 issue

Okay, i think it is fixed.

Can you check version 1.6.2 and tell me if it works ok, please? :roll:
<<

LTee

Posts: 153

Joined: Tue Jul 07, 2009 2:54 pm

Post Sat Jun 24, 2017 2:13 pm

Re: --base-string=1 issue

Okay, first the good news - the 'base=1' string handling seems to work great now, many thanks! :)

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.
Last edited by LTee on Sun Jun 25, 2017 3:34 pm, edited 1 time in total.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sat Jun 24, 2017 8:07 pm

Re: --base-string=1 issue

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:
<<

LTee

Posts: 153

Joined: Tue Jul 07, 2009 2:54 pm

Post Sun Jun 25, 2017 3:34 pm

Re: --base-string=1 issue

Oops, of course - sorry! I've split it out, so you can set this one to solved now.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sun Jun 25, 2017 5:39 pm

Re: --base-string=1 issue

LTee wrote:Oops, of course - sorry! I've split it out, so you can set this one to solved now.

Thanks! :roll:

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO