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

Username:   Password: 
 RegisterRegister   
 Executing Turing Program withing a Turing Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
maddmagg




PostPosted: Sat Jan 20, 2007 7:05 pm   Post subject: Executing Turing Program withing a Turing Program

Hi, just finishing up my summative project and I was wondering if it is possible to start a turing program inside another turing program. My partner and I have a few minigames we want to combine in to an arcade like program and each of the games are quite large so is there a way to do this without simply putting the codes together?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sat Jan 20, 2007 7:25 pm   Post subject: RE:Executing Turing Program withing a Turing Program

Yes, use import statements. You'll find all the explanation for it you need in the Turing Help reference (pressing F10 in Turing).
neufelni




PostPosted: Sat Jan 20, 2007 7:45 pm   Post subject: RE:Executing Turing Program withing a Turing Program

Another option would be to create an exe file of each of the mini games and then use Sys.Exec to execute them.
Cervantes




PostPosted: Sat Jan 20, 2007 8:29 pm   Post subject: RE:Executing Turing Program withing a Turing Program

But that option, Nick, is highly not recommended.

Gandalf suggested using import, which is great. However, that's for importing classes or modules into your program. (It's for importing "Turing Units" into your program: a unit is basically a file containing a class or module, and nothing else). If you actually want to include regular Turing code into your program, use include.
Tony




PostPosted: Sat Jan 20, 2007 9:28 pm   Post subject: RE:Executing Turing Program withing a Turing Program

of course since Turing doesn't support namespaces, make sure that when using includes, there are no name overlaps. If a common variables X and Y are used in more than one game, you might run into trouble.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Robert




PostPosted: Sun Jan 21, 2007 11:26 am   Post subject: Re: RE:Executing Turing Program withing a Turing Program

Tony @ Sat Jan 20, 2007 9:28 pm wrote:
of course since Turing doesn't support namespaces, make sure that when using includes, there are no name overlaps. If a common variables X and Y are used in more than one game, you might run into trouble.


Couldn't he get around that by putting the code for each game in seperate classes within those files?
Clayton




PostPosted: Sun Jan 21, 2007 12:46 pm   Post subject: Re: Executing Turing Program withing a Turing Program

perhaps not classes, but perhaps modules. classes have a very clunky syntax in Turing, whereas modules are just storage for a bunch of procedures and functions. A module could be considered the namespace of Turing I suppose, but then you have to remember to import your module, not include it.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: