Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dim Array At Constant Issue (*solved*)
#1
Bug 
Hi,

I'm trying to dim an array at a specific address which has been defined as a constant of type uinteger, unless I add 0 to the constant the code does not compile. 

const tileStart as uinteger = $4000+384

dim tile(0 to 255) as uinteger at tileStart         'this fails to compile with "Address must be a numeric constant expression" 
'dim tile(0 to 255) as uinteger at tileStart+0         compiles OK

print at 0,0;str(tileStart)

Am I missing something?

This is version: [v1.14.0]
Reply
#2
I'll check that. If you're right you've hit a bug! Thanks for reporting it
It will be fixed in 1.14.1 (soon to be released).
I'll keep you updated here! Smile
Reply
#3
(01-12-2021, 03:27 PM)Ljg701 Wrote: Hi,

I'm trying to dim an array at a specific address which has been defined as a constant of type uinteger, unless I add 0 to the constant the code does not compile. 

const tileStart as uinteger = $4000+384

dim tile(0 to 255) as uinteger at tileStart         'this fails to compile with "Address must be a numeric constant expression" 
'dim tile(0 to 255) as uinteger at tileStart+0         compiles OK

print at 0,0;str(tileStart)

Am I missing something?

This is version: [v1.14.0]

Try this beta and tell me if it works, please! Rolleyes 
http://www.boriel.com/files/zxb/zxbasic-...ta6.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...-beta6.zip
http://www.boriel.com/files/zxb/zxbasic-...-win32.zip
http://www.boriel.com/files/zxb/zxbasic-...x64.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...cos.tar.gz
Reply
#4
Hello Boriel,

Yes that seems to have fixed the DIM AT issue.
:-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)