Computer Science Canada

Import

Author:  blaster009 [ Mon Jan 09, 2006 11:06 pm ]
Post subject:  Import

Just a question: How does importing files work in Turing? I'd love to poke around with it myself, but I'm afraid I don't have time right now...My friend has told me that if I stick all of my procedures in other files which are called from the main one, it should increase the overall speed of my program. Is this correct? Lastly, how does the actual importing syntax itself work? Do I just write "import "filename.t" at the top?

Thanks in advance for any help!

Author:  blaster009 [ Tue Jan 10, 2006 10:54 am ]
Post subject: 

Actually, change of heart: Looking through the help file, I should be using "include", not "import". I'd still like to know however: Is there any real point to importing all my functions and subroutines from sperate files or no? Lol...Thanks again for any help

Author:  person [ Tue Jan 10, 2006 11:30 am ]
Post subject: 

Quote:
it should increase the overall speed of my program


i dont thik it should

Quote:
Is there any real point to importing all my functions and subroutines from sperate files or no?


yes there is, u can basically reuse some functions and subroutines after creating it once

Author:  do_pete [ Tue Jan 10, 2006 11:54 am ]
Post subject: 

Yes there is a point, you can create modules and classes and make them units and then import them using the import statement. For more on classes and modules check out the Turing Walkthrough

Author:  Avarita [ Tue Jan 10, 2006 4:25 pm ]
Post subject: 

If there's a part of your program that you know you will not alter, consider importing it because it reduces scrolling time, especially if a large part of the code will not be altered.

Author:  blaster009 [ Wed Jan 11, 2006 11:09 am ]
Post subject: 

Alright...In that case, I'll keep it as is. Thanks guys


: