Computer Science Canada

Run a Turing source file in a new window

Author:  who cares? [ Thu Nov 06, 2003 7:33 pm ]
Post subject:  Run a Turing source file in a new window

Hey!

I have a program that opens a second window and I want to run a Turing source file in that window. What should I do in order to be able to do that? Thank you very much.

Author:  thoughtful [ Thu Nov 06, 2003 7:49 pm ]
Post subject: 

Well you can do something like
win:int:=Open.Window(size)
inlude "yourfile.t"
Close.Window(win)
in the above code yourfile.t will run in the openedwindow and then close it.

Author:  who cares? [ Fri Nov 07, 2003 5:01 pm ]
Post subject:  thanks for the response, but...

Thank you for the response, but if I use include, that means that the program that I will include will be considered a unit or a module, and I don't want that to happen, because I have procedures in that program and when I ran it, it told me that I can't have procedures in a sub-program. I found out about Sys.Exec, but I can't get it to work. I use it like:

Sys.Exec ("filename.t")

and I also tried

Sys.Exec ("C:\path...\filename.t")

and neither of them worked. Can someone please help me with this problem??? Thank you very much !!!

Author:  Dan [ Fri Nov 07, 2003 5:08 pm ]
Post subject: 

thoughtful wrote:
Well you can do something like
win:int:=Open.Window(size)
include "yourfile.t"
Close.Window(win)
in the above code yourfile.t will run in the openedwindow and then close it.


you have to uses include to open turing code and run it. if you complie the code in to an exe you can use the Sys.Exec methode

Author:  Tony [ Fri Nov 07, 2003 9:21 pm ]
Post subject: 

Sys.Exec is a non-void fucntion, so it returns a value. For this to work, you need to grab that value one way or other. Most common is
code:

if Sys.Exec("file.exe") then
%everything is alright
else
put "error occured"
end if


: