Using IMPORT instead of INCLUDE

BlitzMax Forums/BlitzMax Beginners Area/Using IMPORT instead of INCLUDE

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

As BlitzMAX doesn't have header files, dependancies do have to be one way.

If both files need a particular function, then you should consider putting that function in a third file which can be imported by the other two files.

If you want two files to use a type declared in the other file, then create a parent type and store that in a third file.

For example, my setup is something like:

game.bmx (Defines Terrain type, imports entities.bmx)
entities.bmx (Entity code, but uses terrain code as well)
types.bmx (Defines TerrainBase type, which is what entities.bmx actually uses to call the terrain code in game.bmx)