Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String Arrays problems "nonsense in Basic" - fixed
#1
Thumbs Up 
Hi, I am looking at how to store a string of descriptions into an array.
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
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 :-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)