Import of Include?
Author |
Message |
ClayWall
|
Posted: Mon Nov 21, 2011 10:35 pm Post subject: Import of Include? |
|
|
What is it you are trying to achieve?
Just wondering if there is any reason to use one over the other, and a side question, is there any advantage to saving a file as a ".tu" file or is that just for looks?
What is the problem you are having?
I've searched the site and although I've seen it mentioned that you use one or the other, I was unable to find a reason why to choose one over the other.
Describe what you have tried to solve this problem
I created a program and tried both ways and found both will work. My only conclusion is that it looks nicer to "include" a file, so it includes all objects (and the fact you "include" things in "C"), as opposed to having to import each one. Also there is no confusion between importing into an object and importing file to file.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
import Module1 in "File.tu"
import Module2 in "File.tu"
import Module3 in "File.tu"
or
include "File.tu"
|
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Nov 21, 2011 11:15 pm Post subject: RE:Import of Include? |
|
|
first example of import shows how to do type template~ing. You can't do that with an include (which simply copies file's contents in its place). |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
ClayWall
|
Posted: Tue Nov 22, 2011 12:15 am Post subject: Re: Import of Include? |
|
|
I apologize, I meant from one file to another not into a module. |
|
|
|
|
|
Tony
|
Posted: Tue Nov 22, 2011 12:27 am Post subject: RE:Import of Include? |
|
|
my guess is that you are looking at a specific edge-case where the uses are the same, but overall import comes with more features and can do other things.
That is -- probably doesn't matter for simple cases. Consult documentation for finer points of use. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|
|