
-----------------------------------
Snicket
Tue May 23, 2006 7:32 pm

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

-----------------------------------

Tue May 23, 2006 7:57 pm

Unit and Module
-----------------------------------
You can save other turing files (normally with the extension .tu) that have these lines of 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:


import (module name) in "file.tu"
(module name).(procedure name) 
[/i]

Hopefully that helps.

-----------------------------------

Tue May 23, 2006 8:02 pm


-----------------------------------
I'll attach this, a program using modules and import when I was first trying it to guideline you.

-----------------------------------
Snicket
Tue May 23, 2006 8:10 pm


-----------------------------------
Thanks, just trying to decipher the code. But I get the general idea.

-----------------------------------
Snicket
Tue May 23, 2006 9:02 pm


-----------------------------------
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.

-----------------------------------

Wed May 24, 2006 12:05 am


-----------------------------------
Yay I helped someone for once! =D Now I feel special!
