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

Username:   Password: 
 RegisterRegister   
 [Tutorial] The Include Command (Use more than 1 .t file)
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
iop




PostPosted: Thu May 20, 2004 6:55 pm   Post subject: (No subject)

Let me show you using code. This is the code for the main menu:
Quote:
import GUI
var b1, b2, b3 : int

b1 := GUI.CreateButton (0, 0, 0, "Screen Saver 2", /*What do I need to put in here to run "bouncing circles.t"?*/)
b2 := GUI.CreateButton (0, 75, 0, "Screen Saver 1", /*What do I need to put in here to run "spawning circles.t"?*/)
b3 := GUI.CreateButton (0, 150, 0, "Quit", GUI.Quit)

loop
exit when GUI.ProcessEvent
end loop


The 2 attached files are the files that I need turing to enter when either b1 is pressed or b2.



spawning circles.t
 Description:

Download
 Filename:  spawning circles.t
 Filesize:  1.95 KB
 Downloaded:  225 Time(s)


bouncing circles.t
 Description:

Download
 Filename:  bouncing circles.t
 Filesize:  3.19 KB
 Downloaded:  193 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Thu May 20, 2004 7:12 pm   Post subject: (No subject)

no no... yu have to look up on turing 'modules' but ill give ya a brieif lesson





code:


%% this is the module file named extrastuff.tu

unit
module extrastuff % notice same name as file name
export main % name of the proc or procs with  ',' to seperate
proc main
put "Hello"
end main
end extrastuff



code:


%% this is ur menu program
import GUI, extrastuff %% cant have spaces in export or import names

%% to use that proc from that other file... simple do this

extrastuff.main
% that will run the extrastuff file, and do the 'main' proc
%% note names of procs and files are case sensitive



for more help... check out Cervantes puzzles in source code... i made a launcher using GUI menu and turing UNITS.... and gave it to him,....
its all u need...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 17 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: