Compiling with a Framework

BlitzMax Forums/BlitzMax Programming/Compiling with a Framework

andre72(Posted 2007) [#1]
I hope somebody can explain my the differents between these sources:

I can compile this without problem:
Framework BaH.DateTime
Import BRL.StandardIO
Local d:TDate = TDate.localDay()
Print d.weekNumber()

I get an error when I try to compile:
Local d:TDate = TDate.localDay()
Print d.weekNumber()

Also not possible to compile:
Framework BaH.DateTime
Import BRL.StandardIO
Local d:TDate = TDate.localDay()
Print d.weekNumber()
Local Window:TGadget = CreateWindow("Pic Explorer Window", 100, 100, 700, 470, Null, WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS | WINDOW_STATUS)

My problem is the last example - I like to use BaH.DateTime and gadgets in one source - but can't find out to make it to work ...

Thanks

Andre


Dreamora(Posted 2007) [#2]
your problem with the last is that you have nowhere included brl.win32maxgui (or whatever platform you are) and a few other.


ziggy(Posted 2007) [#3]
Until you don't learn a little bit more how framework works, I would recomend you to use just the import statement for third party modules.
Example:
Import BaH.DateTime
Local d:TDate = TDate.localDay()
Print d.weekNumber()
Local Window:TGadget = CreateWindow("Pic Explorer Window", 100, 100, 700, 470, Null, WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS | WINDOW_STATUS)


Import will add any third party module to the actual EXE. Framework will include ONLY the specified module (and its dependent modules) to the actual EXE.

I recomend you to use only import statements while developing, and then use the framework assistant to add the the final framework and import statements when going to release the application, to minimize the EXE size. It is also a good idea to use a EXE packer or my wonderful BLIde Plus Professional Publisher to add the EXE a ICON and make it smaller and let it have the default system style (XP or Vista). (Just assuming you're developing on windows platform).


Brucey(Posted 2007) [#4]
I also find that starting with the biggest common module helps too...
For example, if I were using MaxGUI, I would use that as my Framework, and Import the other things I needed.

For now though, do as ziggy recommends, and don't use Framework.
Not using it will auto-import all BRL and Pub modules for you. You still need to add modules from other packages (like BaH.)


Dreamora(Posted 2007) [#5]
Its not wise to framework during development anyway.

For 2 reasons:

1. you will face errors where theoretically are none
2. brl updates stuff through syncmods and can even move them from one module to a different one. in that case you run into an error that isn't one as well.


andre72(Posted 2007) [#6]
Ok I understand. Using Import works fine.

Thanks for your support!