Another use for Framework is to create your own frequently used frameworks. For example, you might want to build small console apps that use only Print and Input, so you could create a module like this example:
' Saved as io.bmx in a folder called mod\pub.mod\io.mod,
' followed by Build Modules from the IDE...
Module pub.io
ModuleInfo "Simple Print/Input Framework"
Import brl.standardio
Then whenever you want to build a simple console app with no extra frills you can just create a new source file and stick the framework name at the top, eg.:
Framework pub.io
Print "Hello world!"
... for a 37K app. Wanna hack out another little console app?
Framework pub.io
Print "Wow, it's so easy now I've created a framework for console apps!"
If you wanted another framework with some file I/O operations you could create another module, eg.:
' Saved as fio.bmx in a folder called mod\pub.mod\fio.mod,
' followed by Build Modules from the IDE...
Module pub.fio
ModuleInfo "Simple Print/Input Framework with File I/O"
Import brl.standardio
Import brl.filesystem
You can then easily create console apps that can read and write files just by specifying that framework instead:
Framework pub.fio
Print "Hello world!"
test = WriteFile ("test123456789.xyz")
If test
Print "OK! Created test file. Deleting..."
CloseFile test
DeleteFile "test123456789.xyz"
Print "Done."
EndIf
This can be extended to full game setups, eg. you could create a framework module for simple 2D games (eg. "Framework simple2d"), 3D stuff with physics modules imported (eg. "Framework 3dphys") or not imported (eg. "Framework 3dnophys"), etc, etc. You slap the framework name at the top of your program and only compile in what you need.