Import problem

BlitzMax Forums/BlitzMax Beginners Area/Import problem

N3m(Posted 2005) [#1]
Hi, i have a problem with importing files.

In my main.bmx file i import all the files from my project.

Strict
Import "file1.bmx"
Import "file2.bmx"
Import "file3.bmx"


When i want to use type or function from file1 in file2 i had also to import file1 in file2. so far everithing is okay, but if i want to use stuff from file1 in file2 and stuff from file2 in file1 i got allways the "Dublicate Identifier Error". What can i do against this?.


Dreamora(Posted 2005) [#2]
You can't do anything against it beside a more logical separtion of code as you actually seem to have a abstraction failure in your construction.


N3m(Posted 2005) [#3]
what for a separation would you suggest?

The two classes in the files are independent from the other one but both have methods to covert them to the other one.


FlameDuck(Posted 2005) [#4]
A more distinct seperation of concerns. While it's hard to give any direct advice without seeing the code, I would suggest making a third type to handle conversions, rather than having the two types handle it themselves.

Again without seeing a specific code example it's hard to say if there's an even more elegant way to solve this.