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

Username:   Password: 
 RegisterRegister   
 Using the include command for a program with processes?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GodsObscure




PostPosted: Sun Jan 17, 2016 12:57 pm   Post subject: Using the include command for a program with processes?

Alright, so I am making a rather complex game, and I want to keep my code neat. I have two parts of the game coded, but I want to include them in a menu, so when a condition is met, than the code runs
So I have it like
if blahblah then
include "blah.t"
end if

But. blah.t has processes in it, and I have basically understood you can't do this. Does anyone know of any other commands, or ways to do this? Without the tedious task of trying to put them all in one program? Thanks!
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sun Jan 17, 2016 5:26 pm   Post subject: RE:Using the include command for a program with processes?

'include' basically just copy & pastes the code from the included file into the file you included it in. If it doesn't make sense to type the code there, then it doesn't make sense to include it there either.

You really just want to do it like this:

code:
include "blah.t"
if blahblah then
    procedure_in_blah()
end if


Also, even though I have no idea what your program is or what you're using processes for, I'm 100% sure you're using them wrong. Unless you really know what you're doing, then processes should only be used to play music. You should be using functions or procedures instead.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: