Computer Science Canada Importing Modules that are in seperate files? |
Author: | poww10s [ Fri Apr 04, 2014 11:57 pm ] | ||
Post subject: | Importing Modules that are in seperate files? | ||
What is it you are trying to achieve? Import a Module that is in a Sub Folder to the main programs directory. What is the problem you are having? I have no clue how to do it. The only thing I have thought of was using the Directory stuff. Describe what you have tried to solve this problem Messing with the Directory commands. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Just gonna put this:
Please specify what version of Turing you are using 4.1 |
Author: | Dreadnought [ Sat Apr 05, 2014 9:33 am ] | ||
Post subject: | Re: Importing Modules that are in seperate files? | ||
What you're missing is the "in" keyword.
|
Author: | Raknarg [ Sat Apr 05, 2014 11:26 am ] |
Post subject: | RE:Importing Modules that are in seperate files? |
Another point: As far as I'm aware, you cannot do anything with the directory before you import. If you want to import anything, import has to be the first line of code. |
Author: | poww10s [ Sat Apr 05, 2014 4:25 pm ] |
Post subject: | RE:Importing Modules that are in seperate files? |
Oh, this makes sense. thanks a lot! |
Author: | Clayton [ Thu Apr 10, 2014 6:34 am ] | ||
Post subject: | Re: Importing Modules that are in seperate files? | ||
Dreadnought @ Sat Apr 05, 2014 9:33 am wrote: What you're missing is the "in" keyword.
This is only true if the unit file isn't placed within the same directory that the main program would compile from at runtime. If they are in the same directory however, telling the compiler where to find the module is not entirely necessary. |
Author: | Raknarg [ Thu Apr 10, 2014 10:03 am ] |
Post subject: | RE:Importing Modules that are in seperate files? |
If you're going to bother with additional units, it might be better practice to have a directory for them |