Post Wed Jul 23, 2014 7:01 pm

Should I be able to declare an array of @ addresses?

Not sure if this is a bug or not, so I thought I'd pose the question first. :)

I read this post from last year, which suggests that @ addresses should now be treated as constants:

So I figured I should probably be able to make some labels and then do something like this:
dim addressMap(4) as uinteger => {@label1,@label2,@label3,@label4}

... except I can't - the compiler won't accept the @ addresses as being constants if they're being used to initialise an array.

So I though I might cheat and try to do this instead:
const c1 as uinteger = @label1
const c2 as uinteger = @label2
const c3 as uinteger = @label3
const c4 as uinteger = @label4

dim addressMap(4) as uinteger => {c1,c2,c3,c4}

... but that doesn't work either - it doesn't think the constants are constant either. :)

Should either of those things work? Or am I going about doing this the wrong way? I'm importing some data in asm defb format and thought I might use the @ addresses of some ZX Basic labels to refer to various points within the data. Using 1.4.0-s1885, by the way. Thanks for any input!