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

Username:   Password: 
 RegisterRegister   
 Opening other turing files in the same window
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Snicket




PostPosted: Tue May 23, 2006 7:32 pm   Post subject: Opening other turing files in the same window

I am trying to make a program to be a menu for a game but be seperate from the main code to make it less confusing. I know one way to do it but that opens up a whole new window. Any help welcome. Thanks
Sponsor
Sponsor
Sponsor
sponsor
Guest




PostPosted: Tue May 23, 2006 7:57 pm   Post subject: Unit and Module

You can save other turing files (normally with the extension .tu) that have these lines of code:

code:

%file
unit
module (module name)
export (procedure name)
*code placed here with procedures*
end (module name)


Then you can import it in your main program, with this:

code:

import (module name) in "file.tu"
(module name).(procedure name)
[/i]

Hopefully that helps.
Guest




PostPosted: Tue May 23, 2006 8:02 pm   Post subject: (No subject)

I'll attach this, a program using modules and import when I was first trying it to guideline you.
Snicket




PostPosted: Tue May 23, 2006 8:10 pm   Post subject: (No subject)

Thanks, just trying to decipher the code. But I get the general idea.
Snicket




PostPosted: Tue May 23, 2006 9:02 pm   Post subject: (No subject)

Finally got it to work. I had import and export written in my program a couple of times that threw me off. Thanks a lot.
Guest




PostPosted: Wed May 24, 2006 12:05 am   Post subject: (No subject)

Yay I helped someone for once! =D Now I feel special!
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  [ 6 Posts ]
Jump to:   


Style:  
Search: