Aah. When you get onto BIG projects, stuff starts to get FREAKY.
For example, take this:
FreeStuff.dba:
`Filename: FreeStuff.dba
function FindFreeObject()
for i=1 to 65535
if object exist(i)=0 then exit
next i
endfunction i
ACube.dba:
`Filename: ACube.dba
#include "FreeStuff.dba"
function MakeSpecialCube()
num=FindFreeObject()
make object cube num,-110.0
`no red, no green, no blue = black
color object num,rgb(0,0,0)
endfunction num
RunThis.dba:
`RunThis.dba (the main project file)
#include "FreeStuff.dba"
#include "ACube.dba"
cubenum=FindFreeObject()
make object cube cubenum,100.0
color object cubenum,rgb(255,255,0)
set ambient light 100
cube2num=MakeSpecialCube()
sync on
sync rate 0
do
rotate object cubenum,wrapvalue(object angle x(cubenum)+1.0),wrapvalue(object angle y(cubenum)+1.0),wrapvalue(object angle z(cubenum)+1.0)
rotate object cube2num,object angle x(cubenum),object angle y(cubenum),object angle z(cubenum)
sync
loop
So the dependencies are as follows:
Quote: "
FreeStuff.dba <----------------- RunThis.dba
FreeStuff.dba <-- ACube.dba <--- RunThis.dba
"
Key:
(This Would Be Relied On By <--------- This)
What DBC actually does, is it processes the #include's and puts them all in one big temporary file.
So, in theory, in processing RunThis.dba, it sees an #include for FreeStuff.dba and sticks all the functions in there at the bottom of the RunThis.dba, then it sees ACube.dba included, so it processes THAT file, only to see ANOTHER include for FreeStuff.dba....
End result? DB ends up with two FindFreeObject() functions.
Now, in this example, it's pretty clear that you can just take the #include out of ACube.dba, and everything will work nicely.
However, when you make it so that your include'd files can actually be run as programs, (for diagnostic reasons), then..... well, problem.
How's my typing? Phone 0800-GO-TO-HELL