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

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: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

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

Post by XavSnap »

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.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
Paul
Posts: 1511
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 »

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