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

Username:   Password: 
 RegisterRegister   
 Error stopping a process also code help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Copler




PostPosted: Thu Nov 20, 2003 9:11 pm   Post subject: Error stopping a process also code help

I need help with my code:

Unfinished Program

For one thing I cant actually stop the proc Star_Feild
(a little program made to simulate travel through space)

When I try navigating when I click New the StarFeild is still going
and i cant figure out how to stop/pause the proc can I have some help please? Mad

PS Not Finished Yet

See the attachment below
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu Nov 20, 2003 9:38 pm   Post subject: (No subject)

to exit a procedure use return
Copler




PostPosted: Thu Nov 20, 2003 9:49 pm   Post subject: I realize that

I already know about return and alot of that stuff!! Mad
Evil or Very Mad Sad Smile Very Happy Laughing
But THX!

But I really meant how do you signal from outside of the proc for it to end.
I tried with signal but it sais that it can only be used with in a monitor and I do need to know WHY IT DOESNT WORK!!
Mazer




PostPosted: Thu Nov 20, 2003 9:56 pm   Post subject: (No subject)

code:

proc Star_Feild (Run : boolean)

for starters, you should get rid of the Run parameter. the procedure isn't run at the same time as the rest of the program, and even if it were (ie, if you made it a process), parameters are passed to procs and processes by value, not by reference. that just means once you call the function and say that Run is true, Run will always be true until the next time you call the proc/process. a solution to this could be to make Run a global variable, and make Star_Feild have no parameters.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: