Just a quick question on importing code.
Let's say I have three files, called A, B and C.
A is the "main" file. B and C are additional functions and data. B uses some of the functions of C, while C is standalone. A uses functions of both B and C.
Where should the "import" commands go?
I tried putting the two commands in A, like so:
But to no avail. During compilation, Max replied (using Strict mode) that it couldn't find a Type that was accessed in B, but declared in C. So I swapped the files, but that had no effect.
I got a working solution by importing file B from file A (if you follow), and importing C from B.
However I'm concerned. I plan to have many future files - D, E, F and so forth, each corresponding to different areas of the game. Each will want to access the other. Do I simply include the import code in each file? So, for example, File B will have:
Whilst file E may have
This won't cause any bloating of the exe file will it? Will BlitzMax recognise that File C has already been compiled?
Is there a better way of managing the imports, or is this correct?
Thanks!
Let's say I have three files, called A, B and C.
A is the "main" file. B and C are additional functions and data. B uses some of the functions of C, while C is standalone. A uses functions of both B and C.
Where should the "import" commands go?
I tried putting the two commands in A, like so:
import "File B" import "File C"
But to no avail. During compilation, Max replied (using Strict mode) that it couldn't find a Type that was accessed in B, but declared in C. So I swapped the files, but that had no effect.
I got a working solution by importing file B from file A (if you follow), and importing C from B.
However I'm concerned. I plan to have many future files - D, E, F and so forth, each corresponding to different areas of the game. Each will want to access the other. Do I simply include the import code in each file? So, for example, File B will have:
import "File C"
Whilst file E may have
import "File B" import "File C" import "File D"
This won't cause any bloating of the exe file will it? Will BlitzMax recognise that File C has already been compiled?
Is there a better way of managing the imports, or is this correct?
Thanks!