02-27-2021, 04:12 PM
(This post was last modified: 02-27-2021, 04:59 PM by RandomiserUsr.)
Hi, I am looking at how to store a string of descriptions into an array.
Sounds straight forward enough, so should be something like
So it should print.
This description 1 : The quick brown fox jumps over the lazy dog.
It is being compiled with
But all I get when I run it in the ZX Spectrum emulator is
C Nonsense in BASIC, 30:1
Any ideas why?
I think this is down to memory?
thanks
Ken
UPDATE:
It seems that all I needed to do is declare A$(100,200) as A$(100) and access it via print A$(1) and that is it - nice to fix things along the new road :-)
Sounds straight forward enough, so should be something like
Code:
DIM A$(100,200)
LET A$(1,1)= "This description 1 : The quick brown fox jumps over the lazy dog."
LET A$(2,1)= "This description 2 : The quick brown fox jumps over the lazy dog."
LET A$(3,1)= "This description 3 : The quick brown fox jumps over the lazy dog."
LET A$(4,1)= "This description 4 : The quick brown fox jumps over the lazy dog."
[size=small][font=Tahoma, Verdana, Arial, sans-serif]PRINT A$(1,1)[/font][/size]
So it should print.
This description 1 : The quick brown fox jumps over the lazy dog.
It is being compiled with
Code:
zxbc aTest.bas --tzx --BASIC --autorun --debug-array
C Nonsense in BASIC, 30:1
Any ideas why?
I think this is down to memory?
thanks
Ken
UPDATE:
It seems that all I needed to do is declare A$(100,200) as A$(100) and access it via print A$(1) and that is it - nice to fix things along the new road :-)