Computer Science Canada Importing |
Author: | iop [ Thu May 20, 2004 2:41 pm ] |
Post subject: | Importing |
I have an ISP to do, and for now, it's running pretty good. However I have a problem. For my ISP I have to do screen savers. Instead of making one big Turing file, I decided to make each screen saver its own Turing file. Now I am wondering how can I import all of the screen savor files into my main menu file? Code for Menu (This is just something that I wrote quickly so that it would be easier for me to get help. If I need to post up my Screen saver Turing files, I will do that also) Quote: import GUI var b1, b2, b3 : int b1 := GUI.CreateButton (0, 0, 0, "Screen saver1", ss1) b1 := GUI.CreateButton (100, 0, 0, "Screen saver1", ss2) b1 := GUI.CreateButton (200, 0, 0, "quit", GUI.Quit) loop exit when GUI.ProcessEvent end loop |
Author: | SuperGenius [ Thu May 20, 2004 2:45 pm ] |
Post subject: | |
you could make a main program which would list the available screensavers and have an if-elsif structure that would 'include' one of them based on the user's input |
Author: | iop [ Thu May 20, 2004 2:57 pm ] |
Post subject: | |
I have tried it both ways, with making using GUI buttons, and as a if statement. About attached files. ISP is with the if statement, ISP2 is with the GUI buttons |
Author: | SuperGenius [ Thu May 20, 2004 3:00 pm ] |
Post subject: | |
your code for the first one has 13 errors. if you fix it up then i'll look at it. |
Author: | iop [ Thu May 20, 2004 3:04 pm ] |
Post subject: | |
It has 13 errors because I have Procs inside an If statement. I am trying to get that fixed. I'm also trying to figure out how to import correctly |
Author: | iop [ Thu May 20, 2004 4:29 pm ] |
Post subject: | |
How can I get something like this to work? Quote: var choice : int
get choice if choice = 1 then import "mod1.t" end if or this Quote: import GUI, ss1 in "mod1.t", ss2 in "mod2.t"
var b1, b2, b3 : int b1 := GUI.CreateButton (0, 0, 0, "Screen saver1", ss1) b1 := GUI.CreateButton (100, 0, 0, "Screen saver1", ss2) b1 := GUI.CreateButton (200, 0, 0, "quit", GUI.Quit) loop exit when GUI.ProcessEvent end loop |