Should I be able to declare an array of @ addresses? - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: Should I be able to declare an array of @ addresses? (/showthread.php?tid=599) |
Should I be able to declare an array of @ addresses? - LTee - 07-23-2014 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: <!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/post4283.html?hilit=%20not%20constant%20#p4283">post4283.html?hilit=%20not%20constant%20#p4283</a><!-- l --> So I figured I should probably be able to make some labels and then do something like this: Code: 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: Code: const c1 as uinteger = @label1 ... 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! |