![]() |
for/next/step - did i find a bug? - 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: for/next/step - did i find a bug? (/showthread.php?tid=396) |
for/next/step - did i find a bug? - nitrofurano - 11-03-2011 i don't know if this is a bug, or if i'm defining variable kind wrongly ('j' is not stopping at '0') - thanks in advance! ![]() Code: border 0:cls Re: for/next/step - did i find a bug? - boriel - 11-03-2011 This has been discussed many times. You're defining j variable as Uinteger, so a FOR from 16384 DOWNTO 0 will stop when the j variable passes beyond 0, thus negative. This will never happen, because j is always positive (UInteger), so it overflows from 0 to (65535 - 31) and never stops Re: for/next/step - did i find a bug? - boriel - 11-07-2011 Did you try changing the value type? :roll: Re: for/next/step - did i find a bug? - nitrofurano - 11-07-2011 boriel Wrote:Did you try changing the value type? :roll:nope, i kept uinteger, because i were only using values from 0 to 65535 - btw, i got that overflow issue you told, and this situation is focusing me on try different aproaches when coding - thanks |