Import from parent folder?
Monkey Forums/Monkey Programming/Import from parent folder?
| ||
Lets say I have a module structure: module/module.monkey module/import1.monkey module/folder/import2.monkey in module.monkey I: "Import import1" "Import folder.import2" in import1.monkey I: "Import module" in import2.monkey I: ? Is there a way to do "Import ..module"? e.g. import from a parent directory? I could currently either put all source files in the root folder, or hard code the module path... any better ideas? |
| ||
Import module does not work? If not, then i guess it is a bug. Or is the module name the same as a class name? |
| ||
import "../module.monkey" |
| ||
Are you kidding me? Cool thanks will try that :D |
| ||
Import module should work |
| ||
What Ziggy says. Your app dir is it's own little module hierarchy, so you can reach any module in the app by importing it 'from the top'. eg: myapp.monkey 'contains 'Main'. myutils/util1.monkey myutils/util2.monkey util1 can be reached from anywhere in the app using Import myutils.util1. |
| ||
Had the same issue. tnx |
| ||
If I import "native/system.cpp" from my module, how would i access a header file from the system.cpp file? "#include ../../file.h" would include it from my project using the module not the module? |