LET A(2 TO 4)=A(5 TO 7) doesn't work

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
MOB-i-L
Posts: 43
Joined: Mon Apr 19, 2010 12:13 am
Location: Lund, Skåne/Scania, Sweden
Contact:

LET A(2 TO 4)=A(5 TO 7) doesn't work

Post by MOB-i-L » Sun Mar 16, 2014 4:23 pm

On the ZX81 I do

Code: Select all

10 DIM A$(10)
20 LET A$(2 TO 4)=A$(5 TO 7)
30 DIM A(10)
40 LET A(2 TO 4)=A(5 TO 7)
But I get syntax-error on the last line after 2. I think this should work because this works in MATLAB. Still, it's good that it works for strings.
Last edited by MOB-i-L on Wed Mar 19, 2014 8:12 am, edited 1 time in total.

User avatar
XavSnap
Posts: 795
Joined: Sat May 10, 2008 4:23 pm

Re: LET A(2 TO 4)=A(5 TO 7) doesn't work

Post by XavSnap » Sun Mar 16, 2014 7:11 pm

Hi,
This syntaxe is wrong...
30 DIM A(10)
40 LET A(2 TO 4)=A(5 TO 7)
... a A(2 TO 4) is not a string value!


But,
30 DIM A(10,7)
40 LET A(2, 4)=A(5,7)
is Ok.

User avatar
Paul
Posts: 1042
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: LET A(2 TO 4)=A(5 TO 7) doesn't work

Post by Paul » Sun Mar 16, 2014 9:27 pm

I wonder if the developer(s) of the Sinclair Basic ROM had a working copy of matlab ;) as a reference for developing Sinclair Basic.
In theory, there is no difference between theory and practice. But, in practice, there is.

Post Reply