Author |
Message |
Rocket
|
Posted: Tue Jun 06, 2006 5:26 pm Post subject: Calling on other programs |
|
|
Here what i would like to do
i have program A
A gives a choice to call on program B , C, and D
when B, C, or D is finished it will again call on A
Is it possible to have program B,C and D as seperate t files but have prgram a load them and display them in the same run window
if yes how do i do this |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Tue Jun 06, 2006 6:23 pm Post subject: (No subject) |
|
|
Check out "include". |
|
|
|
|
|
bluedevils_77
|
Posted: Tue Jun 06, 2006 7:38 pm Post subject: (No subject) |
|
|
its called importing and exporting
in program B,C,D hvae
unit
export (name) hello
procedure(name) hello
end (name) hello
if name was hello
then in program A hvae
import "hello.tu"
then when want it to run
(program name , what u save it as).hello |
|
|
|
|
|
HellblazerX
|
Posted: Tue Jun 06, 2006 8:30 pm Post subject: (No subject) |
|
|
I've never gotten into classes in Turing, but if I'm not mistaken, import and export is generally for classes right? I think Rocket just wants general programs or code, so include would be the method for him. |
|
|
|
|
|
Rocket
|
Posted: Tue Jun 06, 2006 9:25 pm Post subject: (No subject) |
|
|
no blue devil did what i want i think, plus if i use units, im gonna get super marks! thanks dude |
|
|
|
|
|
TheOneTrueGod
|
Posted: Tue Jun 06, 2006 9:29 pm Post subject: (No subject) |
|
|
I think what bluedevils_77 said will only work in one file. If you have two different .t files, you're going to need to include them... It doesn't matter if the other file is a unit or not. |
|
|
|
|
|
Rocket
|
Posted: Tue Jun 06, 2006 9:32 pm Post subject: (No subject) |
|
|
sorry for the double post but i cant find an edit button...
#1 from program B, C, D how would i call on A again.
#2 if i have varibales in B,C,D will my code still run if they are declared in B,C, D |
|
|
|
|
|
Clayton
|
Posted: Tue Jun 06, 2006 9:47 pm Post subject: (No subject) |
|
|
ok lets get this straight : units are generally modules,not classes, modules are only a collection of procedures, functions, and processes and nothing else, so for your purposes i believe you wish to include your programs, not units |
|
|
|
|
|
Sponsor Sponsor
|
|
|
bluedevils_77
|
Posted: Wed Jun 07, 2006 7:57 pm Post subject: (No subject) |
|
|
first of all whats an include
and second u can import many other .tu files in other turing programs |
|
|
|
|
|
Clayton
|
Posted: Wed Jun 07, 2006 8:01 pm Post subject: (No subject) |
|
|
include is a command that looks for the program name specified after it and basically copies and pastes it into that part of your code ex. (assume we have a program called test.t in the folder with this)
that simple |
|
|
|
|
|
bluedevils_77
|
Posted: Wed Jun 07, 2006 8:04 pm Post subject: (No subject) |
|
|
first of all whats an include
and second u can import many other .tu files in other turing programs |
|
|
|
|
|
Clayton
|
Posted: Wed Jun 07, 2006 8:19 pm Post subject: (No subject) |
|
|
why did you post the exact same thing an hour after you posted the first one? did you even read my post? look through the Turing Walkthrough and read through it, you might learn something on the way |
|
|
|
|
|
Rocket
|
Posted: Wed Jun 07, 2006 9:44 pm Post subject: (No subject) |
|
|
well from the above posts it sounds like include will work, but howif i ahve it in a procedure would it go like this
code: | %this program is called A.t
proc runB
include B.t
end runB |
code: | %and then progrma B would look like this
proc runA
include A.t
end runA |
and this will all stay in te same window |
|
|
|
|
|
Clayton
|
Posted: Wed Jun 07, 2006 10:02 pm Post subject: (No subject) |
|
|
thats exactly how it would work, because like i said, include basically just copies the file in question and pastes it into the program you have running |
|
|
|
|
|
Rocket
|
Posted: Thu Jun 08, 2006 2:02 pm Post subject: (No subject) |
|
|
and then if a was called again the varables wouldn't be screwed up? |
|
|
|
|
|
|