![]() |
|
Array of addresses - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://forum.boriel.com/forumdisplay.php?fid=15) +---- Thread: Array of addresses (/showthread.php?tid=274) |
Array of addresses - britlion - 2010-07-17 I'm trying to make an array of sprite pointers. The compiler doesn't seem to like Code: DIM Sprites(5) AS uInteger => {@sprite1,@sprite2,@sprite3,@sprite4,@sprite5,@sprite6}And I'm not quite sure why. It reports the error: Initializer expression is not constant. - and I beg to differ. I thought @label WAS a constant? Re: Array of addresses - boriel - 2010-07-19 britlion Wrote:I'm trying to make an array of sprite pointers.The compiler does not currently support this. Sorry. It's constant, as you say, but hard to know in compiler-time. Think of how will you code this array in asm: Code: __Sprites:Re: Array of addresses - britlion - 2010-07-20 Understood. I'm surprised that nobody has put this functionality to do this in standard assemblers for decades, though. I can't be the only person that thinks doing Code: for n=0 to framesOr something that's conceptually similar, is a cunning way to do sprite animations.. I suppose, since sprites are of a fixed size, people have always treated them as vectors and calculated the pointers from a base.. |