BlitzMax 1.09 and Framework

BlitzMax Forums/BlitzMax Beginners Area/BlitzMax 1.09 and Framework

Koekelas(Posted 2005) [#1]
Framework BRL.GLMax2D
Import BRL.Basic
Import BRL.System


... worked fine under BlitzMax 1.06. Under BlitzMax 1.09 it says: identifier Rnd not found so I added:

Import BRL.Random


... but still it says: identifier Rnd not found. Huh? What's the problem?


Thanks, Nicolas.


Perturbatio(Posted 2005) [#2]
I don't know what's happening, this works fine for me:
Framework BRL.GLMax2D
Import BRL.Basic
Import BRL.System

Print Rnd(10,100)


maybe try rebuilding mods completely (release and debug)?


Koekelas(Posted 2005) [#3]
No, I still get the error. The strange thing is that it only happens when Rnd is located in an other source file.

This works:
Framework BRL.GLMax2D
Import BRL.Basic
Import BRL.System

Print Rnd(1)


This doesn't work:
Framework BRL.GLMax2D
Import BRL.Basic
Import BRL.System
Import "file.bmx"

file.bmx
Print Rnd(1)


EDIT
It's not only happening whit Rnd also whit other commands like Print...


Thanks, Nicolas.


Perturbatio(Posted 2005) [#4]
use include instead of import (either that or you need to import BRL.Random into file.bmx


Koekelas(Posted 2005) [#5]
Importing BRL.Random in file.bmx does the trick, thank you very much.

EDIT
Hmmm. It works but the size of the app isn't changed...


Nicolas.


GW(Posted 2005) [#6]
Perturbatio's right.
I've resorted to using 'Include' for everything. Import is really crusty and as your game gets more complex it will start breaking more.
Plus my game compiles about 2X faster with include.


Dreamora(Posted 2005) [#7]
If you want to use rnd in a file, then you have to import the needed module in THIS file, otherwise the command is not known in it.

This is because each bmx is compiled on its own and linked with the commands imported.


Koekelas(Posted 2005) [#8]
So on top of every file I need

Framework BRL.GLMax2D
...


?

I'll try it when I get home.


Nicolas.


Koekelas(Posted 2005) [#9]
It won't compile using Include or Framework in every source file. It compiles using Import BRL.Random in de source file I need it but there is no difference in app size and the application crashes. It worked perfect in BlitzMax 1.06 why not in 1.09?


Nicolas.


marksibly(Posted 2005) [#10]
Hi,

If you use Framework, it can only appear in the main source file. Also, if you change the Framework in the main source file, you'll need to do a build all.

Also when using Framework: any imported 'child' source files must manually import any non-framework modules they require (or, import another child file that imports the required module).


bradford6(Posted 2005) [#11]
cool,
thanks for the explanation, Mark.

Do you have any plans to create some BMAX tutorials. The OOP one you did was especially good. Mabe some 'art of good bmax programming' guides to get our brains straight.


Koekelas(Posted 2005) [#12]
Thank you Mr. Sibly. I still won't compile but I think I know what to do now.

EDIT
It works now! The app is even a 100K smaller than whit 1.06! Thank you!


Nicolas.