IGlass and BMax 1.20 Update

BlitzMax Forums/BlitzMax Programming/IGlass and BMax 1.20 Update

Booticus(Posted 2006) [#1]
Anyone else notice their module of iGlass magically getting blown away out of the pub folder after updating to BMax 1.20? When I tried compiling my app, I got:

Compile Error: Can't find interface for module 'pub.igl'

So I checked the pub folder and sure enough IGlass was gone. I'm pretty sure that I didn't just up and erase it soooo.......going to keep an eye out for more strangeness...

[edit]
And now that I've put the igl.mod back in the pub folder and compile my app, I get:

Compile Error: Incbin can only be used in main program block

Charming.


Cartman(Posted 2006) [#2]
Confirmed. Mine did the exact same thing. Gone. Seems like its related to the fact that the IGlass mod is in the Pub folder and not in its own. My other modules outside of the Pubs folder are fine.


Booticus(Posted 2006) [#3]
Well, I emailed Filax and we'll see if we can get his attention!! :) If you replace the folder in there it at least sees it again, but then that wierd error shows up.


kfprimm(Posted 2006) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=59113


Booticus(Posted 2006) [#5]
Hey Khomy! Yeah I saw that in the updates:

"+ (BCC) Fixed Incbin so it doesn't matter where it is in code."

Yet I get:

Compile Error: Incbin can only be used in main program block

Shouldn't the update mean that I shouldn't get that error?? It's in an Included file.


kfprimm(Posted 2006) [#6]
Do you get that error when you compile the module or a source file that uses it?


marksibly(Posted 2006) [#7]
Hi,

"+ (BCC) Fixed Incbin so it doesn't matter where it is in code."


Sorry, not well worded. By this I meant that incbins can now be declared lower down in the source file than where they are used - this used to be impossible.

Incbins in an included file should be OK - as long as the included file is included in the 'main' file, eg:
'----- x.bmx -----
Include "y.bmx"
Print InbinLen( "t.txt" )
'----- y.bmx -----
Incbin "t.txt"

You can't, however, use Incbin inside a If/For/Type/While etc. The reason for this is that it implies a level of scoping that just doesn't exist - Incbined filenames are always global, so the Incbins should be too.


Booticus(Posted 2006) [#8]
Ahhhhhhhhhhhhhhh OK. Well, I might not wait for Filax, and just see if I can whip it up myself in the source. Thanks for the reply Mark!


Filax(Posted 2006) [#9]
Sorry Mark

But you tired me with your changes.... This feature is stupid :(

why i can't do an incbin under a function ???? This stuff
work perfectly before ? Sometime,i seriously think of leaving
the blitz world...

Note to customer's : Don't panic, check your mail box :)


Booticus(Posted 2006) [#10]
Bless you Filax!


Filax(Posted 2006) [#11]
:)


N(Posted 2006) [#12]
why i can't do an incbin under a function ????

Because, as Mark said, IncBin has a global scope (or no scope, I suppose, it's just there), so using it in a function would imply some sort of scope inaccessible on a global level.


Filax(Posted 2006) [#13]
Sure, but ....


N(Posted 2006) [#14]
Don't make me hit you with a chair.


Filax(Posted 2006) [#15]
? :/


SSS(Posted 2006) [#16]
If it has no scope why can't it be used in a function? I don't understand. Surely one can use globals whose scope is similar in functions. It's more about program flow than domain really.


popcade(Posted 2006) [#17]
Well, thanks filax first, actually I don't recommend the incbin thing, if possible, use 3rd party packers like BBCruncher or MoleBox.

I found the incbin works slow on some machines, don't know why but it did happen, and moleboxed program loads faster.


N(Posted 2006) [#18]
If it has no scope why can't it be used in a function? I don't understand. Surely one can use globals whose scope is similar in functions. It's more about program flow than domain really.

If you declare a global in a function, then it is global only within the scope of that function.


Beaker(Posted 2006) [#19]
I agree with Noel. There is nothing to be gained from declaring an IncBin inside a function, and there is something to be lost: transparency and comprehension.


Yan(Posted 2006) [#20]
It would be nice to be able to use it in loops with variables though...
For local n=0 to 9
  IncBin "sprite" + n + ".png"
Next
Nothing that can't be generated with a few lines of code, but still.


N(Posted 2006) [#21]
It would be nice to be able to use it in loops with variables though...

For local n=0 to 9
IncBin "sprite" + n + ".png"
Next

Nothing that can't be generated with a few lines of code, but still.


Nice as it would be, it's probably best to write a seperate script or program to generate the code for stuff like that.


RepeatUntil(Posted 2006) [#22]
Hi Filax,

I am one of your customer but I didn't receive any update... Thanks for sending me this at repeatuntil AT free.fr.

Merci !


Kuron(Posted 2006) [#23]
dangit, I changed my email addy again and forgot to tell filax, lol.