Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM a$(100,10) possible bug?
#3
(02-26-2021, 08:03 PM)RandomiserUsr Wrote: Hi, 

I have been developing a game and one of thing things I wanted to is build up a string and print it out but the issue I have is that I can't do the following code in zxbc :-


Code:
DIM a$(100,10)
LET a$(1) = "Line 1"
PRINT a$(1)

But I can do the above in a ZX Spectrum emulator.

I know the solution is to use a$(1,1) (Ignore the zero array start)

PS Brilliant compiler!! 

Thanks,
Ken

(02-28-2021, 05:19 PM)boriel Wrote:
(02-26-2021, 08:03 PM)RandomiserUsr Wrote: Hi, 

I have been developing a game and one of thing things I wanted to is build up a string and print it out but the issue I have is that I can't do the following code in zxbc :-


Code:
DIM a$(100,10)
LET a$(1) = "Line 1"
PRINT a$(1)

But I can do the above in a ZX Spectrum emulator.

I know the solution is to use a$(1,1) (Ignore the zero array start)

PS Brilliant compiler!! 

Thanks,
Ken

Yes. DIM a$(N, length) is not supported.
You have to do DIM a$(N) and if you want fill the 100 slots with "          " (10 spaces).

Also, for better compatibility with Sinclair BASIC, compile with --sinclair

Thanks for confirming this :-)
Reply


Messages In This Thread
DIM a$(100,10) possible bug? - by RandomiserUsr - 02-26-2021, 08:03 PM
RE: DIM a$(100,10) possible bug? - by boriel - 02-28-2021, 05:19 PM
RE: DIM a$(100,10) possible bug? - by RandomiserUsr - 02-28-2021, 05:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)