Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Multiple Module imports
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mistro




PostPosted: Wed Jun 01, 2005 8:06 pm   Post subject: Multiple Module imports

First of all i would like to say that yes i have infact read over the module tutorial. Infact my question was first posted there. However, since someone mentioned that it should be put here along with the fact that i havn't found a workable solution to it yet, i have made a new post. I have also searched before posting this.

Now as for Turing experiance, i have basic experiance with it and i would call myself an intermediate programmer. I do have alot of experiance with other languages such as VB and C++

Now my problem:

Lets say i have two modules. How would i go about importing them into my program? It would probably make sense to do soemthing like:

code:
import (modulename in "filename")
import (modulename2 in "filename2")




However this generates an error

This occurs whenever i import more that two modules. They do not even have to by my own. I also tried to import "GUI" but it also failed when it was second on the list.

I then tried putting GUI first, and the error came up but this time on the second "import" which was my file that i had created.

Some help would be appreciated.

The error is generated at compile.
The compiler highlights the second word "import" alone
The error message says "syntax error at import)


here is the exact code:
code:
import (DragStrip in "dragstripModule.tu")
import GUI



this generates an error for the second import (the one for GUI)

when flipped like so:
code:
import GUI
import (DragStrip in "dragstripModule.tu")



the error occurs on the second import again (this time my own module)



Now Delos was kind enough to offer a solution:
Quote:
You might get a warning popping up there. Import the entire module instead, safer. Easy, wasn't that.


However, if i do something like this:
code:
import "dragstripModule.tu"
import GUI


then i get the same error on the second import. If I put the GUI import first, the error is still on the second import regardless.

Thank you in advance for your help


EDIT: i should also add that its not just the GUI and that extra file which cause errors.

If I use two custom files, the same error comes on the second import statement. If I use two turing Modules, i get the same error again also.
Sponsor
Sponsor
Sponsor
sponsor
lyam_kaskade




PostPosted: Wed Jun 01, 2005 10:31 pm   Post subject: (No subject)

Try putting your imports all in one line:
code:
import "unit1.t", "unit2.t"


I checked it. Got the same syntax error on the second import when I put two, but it worked when they were on the same line.
Mistro




PostPosted: Thu Jun 02, 2005 6:24 am   Post subject: (No subject)

ah thanks! that worked Very Happy I was having the problem with one line and figured that didn't work either since i had it like this:

code:
import (DragStrip in "dragstripModule.tu"), GUI


but this works :
code:
import "dragstripModule.tu", GUI


once again thanks.
StarGateSG-1




PostPosted: Thu Jun 02, 2005 6:35 am   Post subject: (No subject)

that is becasue you don't import the module by itself, you import the whole file or include it. Then you are free to call the module whenever you want.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: