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

Username:   Password: 
 RegisterRegister   
 Opening A File With A Turing EXE
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Carey




PostPosted: Tue Jun 12, 2007 9:12 am   Post subject: Opening A File With A Turing EXE

Is there a way to open a file with a Turing EXE you have made? For example I have demo.txt and TextEditor.exe. Is it possible to open demo.txt with TextEditor.exe and have it do something to it instead of having to run TextEditor.exe then type demo.txt?
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Tue Jun 12, 2007 9:39 am   Post subject: RE:Opening A File With A Turing EXE

http://www.compsci.ca/v3/search.php
Cervantes




PostPosted: Tue Jun 12, 2007 4:49 pm   Post subject: RE:Opening A File With A Turing EXE

When run from the command line, most programs accept an argument that is the file to be opened. So in Turing, use
code:
Sys.Exec ("TextEditor.exe demo.txt")

Assuming TextEditor.exe is in your $PATH.
rdrake




PostPosted: Tue Jun 12, 2007 5:38 pm   Post subject: RE:Opening A File With A Turing EXE

You open a text file with an executable created by Turing the same way as you would any other time. It doesn't matter if you run the program by pressing F1 or by creating an executable and double-clicking it.
Clayton




PostPosted: Tue Jun 12, 2007 5:49 pm   Post subject: RE:Opening A File With A Turing EXE

rdrake, he means using TextEditor to actually recieve the file as an argument and open it in TextEditor. Cervantes' solution should be sufficient.
neufelni




PostPosted: Tue Jun 12, 2007 8:38 pm   Post subject: RE:Opening A File With A Turing EXE

He didn't word his question very well but what I think he means is being able to double click a text file and have it open with the text editor program he created in Turing rather than Notepad.
Clayton




PostPosted: Tue Jun 12, 2007 8:46 pm   Post subject: RE:Opening A File With A Turing EXE

If you're on Windows (which is most likely, I don't think there's been a Mac version for how long?), you can right click on the .txt file and go to Open With -> Other and browse to your .exe I don't know if this will actually work or not, (I have a feeling it won't unless you set up your .exe to accept parameters on execution).
Carey




PostPosted: Fri Jul 13, 2007 8:51 pm   Post subject: Re: Opening A File With A Turing EXE

how do you set up your .exe to accept parameters on execution?
Sponsor
Sponsor
Sponsor
sponsor
DIIST




PostPosted: Fri Jul 13, 2007 10:33 pm   Post subject: Re: Opening A File With A Turing EXE

You can just pass parameters, u dont really have to do any thing except use command line. If you want a gui dialog to pass in paramatues to a Turing exe, just choose the "run with arguments dialog" when u create the exe file. What ever arguments the person passes in, you can get it using fetchargs, and nargs Wink
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  [ 9 Posts ]
Jump to:   


Style:  
Search: