How to include a File

Monkey Forums/Monkey Programming/How to include a File

hardcoal(Posted 2011) [#1]
I have no idea what is the command to include a file when working on jungle IDE.

I have two projects for example and i want to include a file from another project.
how do i do that?


muddy_shoes(Posted 2011) [#2]
Are you asking about adding files to Jungle projects or Importing files in the monkey language?


hardcoal(Posted 2011) [#3]
Importing another code file that is written in jungle
like include on blitz3d


muddy_shoes(Posted 2011) [#4]
I don't understand what jungle has to do with the question. Jungle is just an editor. It makes no difference if you write a monkey file in jungle, monk or notepad.

Usage of the import command is described in the monkey language reference section on modules that I directed you to in a thread yesterday: http://monkeycoder.co.nz/Community/posts.php?topic=1131


Shagwana(Posted 2011) [#5]
What you is after is the 'import' command


hardcoal(Posted 2011) [#6]
Nope. Thats not it or maybe I dont know how to use import.

When you want to Include another code file to your main code file.
what do you do?

Like the command Include does in Blitz3D

Import is for modules only no?


hardcoal(Posted 2011) [#7]
Oh I got it. It works with Import but it has to be on the same folder.


Shagwana(Posted 2011) [#8]
It can import from folders like;

'Import inc.codefile'

For a 'codefile.Monkey' in 'inc' folder