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

Username:   Password: 
 RegisterRegister   
 Compile and Include?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Sun Nov 28, 2004 10:21 am   Post subject: Compile and Include?

I was recently trying to send my friend a program that I had compiled as well as a .t file that the compiled program should use. Unfortunately, the .exe paid no attention to the .t file, even though the include statement worked properly before compiling the program. So, I've come to the conclusion that when they say, "Generate Stand-Alone Program", they really do mean stand-alone. I was wondering if there is any way to make the .exe less of a loner, to get it to make use of the .t that I send with it.
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Nov 28, 2004 11:34 am   Post subject: (No subject)

AFAIK, when you compile a proggie that has an inclde in it, in really does include the source of the destination file within the compiled .exe.
If you still wanted to access a .t file from within the .exe, I'm guessing you'd have to create somewhat of an interpretter-type-module thing that would be able to take a string input, say "put "The world is an oyster"", and then run the command 'put "The world is an oyster"'.
Cervantes




PostPosted: Sun Nov 28, 2004 11:44 am   Post subject: (No subject)

Delos wrote:
AFAIK, when you compile a proggie that has an inclde in it, in really does include the source of the destination file within the compiled .exe.

Sorry, I guess I wasn't clear enough. What I mean is that, yes, the code in the .t is included in the .exe, but only at compile-time. So, if I compile the program, then change some stuff in the .t, the .exe will remain the same as it was at compile-time.
Delos wrote:

If you still wanted to access a .t file from within the .exe, I'm guessing you'd have to create somewhat of an interpretter-type-module thing that would be able to take a string input, say "put "The world is an oyster"", and then run the command 'put "The world is an oyster"'.

that doesn't sound too fun Eh Laughing
Tony




PostPosted: Sun Nov 28, 2004 3:41 pm   Post subject: (No subject)

Cervantes wrote:
So, if I compile the program, then change some stuff in the .t, the .exe will remain the same as it was at compile-time.

yes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
beard0




PostPosted: Sun Nov 28, 2004 6:54 pm   Post subject: (No subject)

Delos wrote:
If you still wanted to access a .t file from within the .exe, I'm guessing you'd have to create somewhat of an interpretter-type-module thing that would be able to take a string input, say "put "The world is an oyster"", and then run the command 'put "The world is an oyster"'.

To do this properly would mean to essentially be writing a compiler for turing, in turing. It would mean being able to interpret every single built-in command. It would be ludicrous. Much better idea: bug the people at Holtsoft who have already written this code, to include it as a command in the next release of turing. Although the likelyhood of getting them to do this is extremely slim, the probable length of time this would take would be much less than the probable length of time to write the interpreter one's self in turing.

Note: This is the reason the name of the file for the include command must be string litteral. Otherwise, you could have it be run-time values, whereas Turing wants to read it as soon as you press F1. I tried playing around with this once when I was making a program for debugging purposes. I wanted to be able to hit a key that would pause my program, and accept an input which would be a command in turing, so I saved the command to a file, then tried to "include" it. No luck: It simply ran what had been stored in the file when I pressed F1.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: