Author |
Message |
Carey
|
Posted: 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
|
|
|
Martin
|
|
|
|
|
Cervantes
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
Posted: 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
|
|
|
DIIST
|
Posted: 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 |
|
|
|
|
|
|