Issue with import.

BlitzMax Forums/BlitzMax Programming/Issue with import.

DH(Posted 2005) [#1]
Had a but posted previously about import declarations.

It was deleted, its not in the bug bin.

Import "PCode_Class.bmx"
Import "Stack_class.bmx"
Import "Script_class.bmx"
Import "compiler.bmx"


The Script_Class doesn't see the pcode_class stuff (error of pcode stuff not found)

If i create a duplicate of the pcode stuff in script_class it errors out as duplicate.

I dont want to have the same type defs (with slightly different names) in each library where they are used, that would be chaotic.

What is the solution. Public doesnt seem to help.

Please help?


Perturbatio(Posted 2005) [#2]
this is not a bug.
create any types you want to share across imported files and then import it into each one, or use include.


Dreamora(Posted 2005) [#3]
Every bmx is its own world. You cant access stuff from x in y and vice verse if they are imported.

As mentioned in your other thread, import the pcode_class.bmx to any other class that needs it. This way there isn't a dublication as the class pcode exists only once in the whole system.


DH(Posted 2005) [#4]
ahhh, so you can use duplicate 'import' files across the board.

Interesting.

Thanks BTW