Explain Module Usage

BlitzMax Forums/BlitzMax Beginners Area/Explain Module Usage

Hardcoal(Posted 2013) [#1]
Can someone explain what Modules are for?

What are the advantages of it.

But a clear explanation not something vague

A nice simple example will also help.

Also there is Extern command that I dont also know what it means.

cheers


Brucey(Posted 2013) [#2]
Modules are useful for creating a library of code that performs a certain function, which you can import into your project when required.
For example, if you want to be able to load PNG pixmaps, you could import BRL.PNGLoader.

There are also a few user-created modules around which add helpful functionality that you may want to use, rather than write your own from scratch.

Extern blocks are a place to define an interface between BlitzMax and external (DLLs, C/C++) libraries. By defining an extern function, you can call it directly from within your BlitzMax application.