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

Username:   Password: 
 RegisterRegister   
 Run a Turing source file in a new window
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
who cares?




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
thoughtful




PostPosted: Thu Nov 06, 2003 7:49 pm   Post subject: (No 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.
who cares?




PostPosted: 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 !!!
Dan




PostPosted: Fri Nov 07, 2003 5:08 pm   Post subject: (No 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
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony




PostPosted: Fri Nov 07, 2003 9:21 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: