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

Username:   Password: 
 RegisterRegister   
 "include" command help?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Leftover




PostPosted: Thu Jan 13, 2005 7:26 pm   Post subject: "include" command help?

Well I've heard many things over past semmester...

I'm wondering, is there any difference in the speed of turing if you use the include command?

The final product will be a turing EXE that will run a cheesy game, and I want to use several include commands for the beginning part of the game, and possible later on (Ex. an include for the introduction to the game, then the main menu, etc.) but if it slows it down heavily, I'd rather leave it in although that's alot of code in 1 file.

It will be created on P3-600 machines and higher, and run on P2-400's to P4 machines (teacher marks on school machines, P2, teacher office machines, P3, and home machine which I assume is P4).

I just want to know if it will create problems in the end is all, as I don't really have enough code for it to create a difference as of right now I don't think.

Thanks in advanced, L.O.
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu Jan 13, 2005 7:59 pm   Post subject: (No subject)

Using the include command won't have any effect on the speed of your program. Or rather, it will, but not because of the include. When you include a file, it has the same effect of copying the text of the file and pasting in at the line with the include statement.
Leftover




PostPosted: Thu Jan 13, 2005 8:23 pm   Post subject: (No subject)

so then essentially unless the PC is too old to handle a quick call to clipboard, it won't have an effect on the end speed?
Mazer




PostPosted: Thu Jan 13, 2005 8:44 pm   Post subject: (No subject)

No, no, it puts it all together once right when the program is run/compiled. Honestly, you won't notice any performance hit. All I was (stupidly) implying was that since you had more code in the program, it would run longer.

Meaning,
code:
put x

would run faster than
code:
put x
put y


Which was just a stupid joke. Really, just use include and don't listen to what I say.
Leftover




PostPosted: Thu Jan 13, 2005 9:14 pm   Post subject: (No subject)

Oh okay, well either way then I am free to use as many includes as I wanted, which I like better to keep the base exe code lines down to a minimum and split the game up into smaller chunks, thanks Smile
Hikaru79




PostPosted: Thu Jan 13, 2005 10:48 pm   Post subject: (No subject)

I thought Turing imported absolutely all of its libraries when you compiled anyway? Isn't that why a simple hello,world program is 300+ kb?
Mazer




PostPosted: Fri Jan 14, 2005 8:45 am   Post subject: (No subject)

Much more than 300kb, but yes. If you look in the predefs folder somewhere, there should be a file which lists off a bunch of files for turing to include. You can delete it (I'd recommend just moving it someplace else or renaming it) so that it doesn't automatically include everything, but even with that the compiled program is quite huge.
[Gandalf]




PostPosted: Sat Jan 15, 2005 2:26 am   Post subject: (No subject)

Hikaru79 wrote:
I thought Turing imported absolutely all of its libraries when you compiled anyway? Isn't that why a simple hello,world program is 300+ kb?

Coutsos wrote:
Much more than 300kb, but yes. If you look in the predefs folder somewhere, there should be a file which lists off a bunch of files for turing to include. You can delete it (I'd recommend just moving it someplace else or renaming it) so that it doesn't automatically include everything, but even with that the compiled program is quite huge.


Oh, so that explains why every turing.exe is so huge, even if it doesn't do too much... I guess it would still be huge anyways since it has to include that turing toolbar, right click popup, music sounds, gui, etc... Are you sure moving the files will work? (can't try it at the moment). Well, its good to know - holtsoft should really allow you to choose what to include, or even better, just automatically include what you are using. It would make the program much more effiecient.
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: