As a C++ programmer, I'm having trouble deciding on how to break down my files into multiple sources.
Say I have 3 files:
test.bmx is listed as:
Import "Ship.bmx"
Import "Alien.bmx"
Local myship:Ship=New Ship
Local enemy:Alien=New Alien
myship.enemy=enemy
enemy.enemy=myship
Alien.bmx is listed as:
Import "Ship.bmx"
Type Alien
Field enemy:Ship
End Type
and Ship.bmx is listed as:
Import "Alien.bmx"
Type Ship
Field enemy:Alien
End Type
When I compile the main program "test.bmx" I get a Duplicate Identifier 'Ship' compiler error. In C++, usually a #ifndef,#define and a #endif directive prevents this sort of thing. Is there something similar in BMax? If not, could there be a possibilty in the future? I guess I could use "include" instead, but "import" is much more desirable.
Say I have 3 files:
test.bmx is listed as:
Import "Ship.bmx"
Import "Alien.bmx"
Local myship:Ship=New Ship
Local enemy:Alien=New Alien
myship.enemy=enemy
enemy.enemy=myship
Alien.bmx is listed as:
Import "Ship.bmx"
Type Alien
Field enemy:Ship
End Type
and Ship.bmx is listed as:
Import "Alien.bmx"
Type Ship
Field enemy:Alien
End Type
When I compile the main program "test.bmx" I get a Duplicate Identifier 'Ship' compiler error. In C++, usually a #ifndef,#define and a #endif directive prevents this sort of thing. Is there something similar in BMax? If not, could there be a possibilty in the future? I guess I could use "include" instead, but "import" is much more desirable.