![]() |
compilation error (*solved*) - 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: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: compilation error (*solved*) (/showthread.php?tid=483) |
compilation error (*solved*) - slenkar - 08-02-2012 I have a compilation eror where it thinks a byte is a label Re: compilation error - slenkar - 08-02-2012 heres the last files. compile wars.bas Re: compilation error - boriel - 08-02-2012 The problem lies in function ChooseNextUnit() Code: const NumUnitsIter as Ubyte = 29 The FOR loop is using NumsUnitIter as a variable, but it's already declared globally as a const. You should add the line Code: Dim NumUnitsIter as Ubyte This is a compiler bug, anyway: it should either stop with an error, or issue a warning "Inner declaration hides global constant", or the like. I will fix it later. Re: compilation error - slenkar - 08-02-2012 thanks :oops: By the way do you think it will be quicker to: 1. take away 1 from a number, or 2. get a global variable? so i can loop through an array with FOR Re: compilation error - boriel - 08-03-2012 slenkar Wrote:thanks :oops:I think the 2nd is faster. Anyway, just use DIM within the function and your code is OK! ;-) (outside the function you will be using the constant). Re: compilation error - boriel - 08-05-2012 This has been fixed (I think). Please, download and install the version 1.2.9s910. Try it and tell me. ![]() Re: compilation error - slenkar - 08-05-2012 yep that works thanks, it says its not a variable |