[solved] NG Bug ?

BlitzMax Forums/BlitzMax NG/[solved] NG Bug ?

wookie(Posted 2016) [#1]
Local aaa:Object[]
For Local i% = 0 To aaa.Length - 1
Print "ITER!"
Next


Program is printing ITER! infinitely


grable(Posted 2016) [#2]
Not really a bug, its the same as writing this:
For Local i:Int = 0 To -1
Next
Its doing exactly what you told it to do. And its not really infinite either, it will reach 0 eventually (going through the entire 32-bit space in the process :p)


Perhaps a better approach would be this, which doesnt suffer from the same "limitation":
Local a:String[]
For Local i:Int = 0 Until a.Length
Next



LT(Posted 2016) [#3]
Well, it doesn't happen in vanilla. I'd say it's a bug, but easily avoidable.


Brucey(Posted 2016) [#4]
That's strange. I wouldn't expect it to print anything...

I tested it on OS X and Win32 ( bcc[ng] Release Version 0.74 ), and it doesn't output anything.


wookie(Posted 2016) [#5]
In every language I know (and I know some) code inside loop is never executed.

By the way first of your example works like it should on NG - code inside loop is never executed.


wookie(Posted 2016) [#6]
@brucey

I've got version 0.71. I will check latest


grable(Posted 2016) [#7]
Hmm guess i was wrong. I actually expected it to work since blitz uses signed integers.
But after thinking a bit, it cant. Since 0 is NOT less than -1 :p


wookie(Posted 2016) [#8]
@brucey

Which files exactly should I grab from github to update my NG?


Derron(Posted 2016) [#9]
@wookie

all things you use from https://github.com/bmx-ng

-> bcc (download and compile bcc.bmx -> replace your bcc then with the new one)
-> bmk (if changed - same procedure)
-> brl.mod (download zip -> extract as brl.mod in bmxng/mod/...)
-> pub.mod (download zip -> extract as pub.mod in bmxng/mod/...)
-> other modules
(if you use git - you just could pull the latest changes to your repositories, which might be already located in mod/brl.mod etc.)

bmk will autocompile all modules (so make sure removing the old brl/pub.mod before, so you do not have some old .bmx-directories and precompilates stored there)


bye
Ron


grable(Posted 2016) [#10]
Or use Frisky which does all that for you ;)
I know ive touted this before, but having to manually do the github dance is not very fun, especially when having to do it more than once!


wookie(Posted 2016) [#11]
So I downloaded and recompiled all (bmk,bcc,modules) and it's... WORKING ! :) Thank you.