Computer Science Canada Ending a process |
Author: | Mephi [ Wed Jun 18, 2003 9:37 pm ] |
Post subject: | Ending a process |
how do you stop a process? im sure this has been posted before, but theres 14 pages of threads and theres no way im gonna search em all:P theres just too many! plz help |
Author: | Blade [ Wed Jun 18, 2003 9:40 pm ] |
Post subject: | |
Quote: Syntax A quitStatement is:
quit [ guiltyParty ] [ : quitReason ] Description The quit statement causes a program (or concurrent process) to fail. The failure (called an exception) either aborts the program (or process) or causes control to be passed to an exception handler. Example In the inputLines procedure, halt the program if end of file is encountered before the string "stop" is read. Note that a return statement in the procedure would terminate the procedure but not the entire program. var line : array 1 .. 50 of string procedure inputLines var i : int := 0 loop if eof then put "Missing 'stop' in input" quit % Halt entire program end if i := i + 1 get line ( i ) exit when line ( i ) = "stop" end loop end inputLines inputLines quote from the turing help file |
Author: | AsianSensation [ Wed Jun 18, 2003 9:46 pm ] |
Post subject: | |
quit quits the entire program however, return will work for processes and procedures |
Author: | Mephi [ Wed Jun 18, 2003 9:46 pm ] |
Post subject: | |
duznt quit close the program? or can u do like quit process or sumthin |
Author: | Blade [ Wed Jun 18, 2003 9:48 pm ] |
Post subject: | |
Quote: Description The quit statement causes a program (or concurrent process) to fail. The failure (called an exception) either aborts the program (or process) or causes control to be passed to an exception handler.
quote again from the turing help file... causes the program (or concurrent process) to fail. |
Author: | Mephi [ Wed Jun 18, 2003 9:50 pm ] | ||||
Post subject: | |||||
ok im confused heres my problem: i have many music files, each is supposed to play at a specific time. it looks like this:
to change music i use
however, when that music ends, it goes back to the old one. basically, it plays once then reverts bak to the old music. how do i stop this |
Author: | AsianSensation [ Wed Jun 18, 2003 9:51 pm ] | ||
Post subject: | |||
this will work, return works the same way for processes as well as for procedures. |
Author: | Mephi [ Wed Jun 18, 2003 10:02 pm ] |
Post subject: | |
but its looped music....so it cant end when its done...cuz itsa loop....and i want it to play more than once....just to end when i want the music to change |
Author: | AsianSensation [ Thu Jun 19, 2003 9:11 am ] | ||||
Post subject: | |||||
have a flag
during the process:
so when you want to exit the process sometimes in your program, turn flagstop true, and then it should stop. |
Author: | Blade [ Thu Jun 19, 2003 11:41 am ] | ||
Post subject: | |||
why dont you use Music.PlayFileStop? it stops the currently playing file..
|
Author: | Mephi [ Thu Jun 19, 2003 6:16 pm ] |
Post subject: | |
does Music.PlayFileStop = Music.SoundOff? cuz i tried Music.SoundOff and it duznt work..still goes bak to the original music... |
Author: | Andy [ Thu Jun 19, 2003 9:02 pm ] |
Post subject: | |
no u can't stop a music while its playing, i dun think |
Author: | Mephi [ Thu Jun 19, 2003 9:25 pm ] |
Post subject: | |
Music.SoundOff stops music |
Author: | AsianSensation [ Thu Jun 19, 2003 10:09 pm ] |
Post subject: | |
Quote: The Music.PlayFileStop procedure is used to to stop all music files currently playing.
straight from the help thingie anyways, i agree with blade, use Music.PlayFileStop. have the flag triggers the Music.PlayFilewStop command. |
Author: | AsianSensation [ Thu Jun 19, 2003 10:12 pm ] | ||
Post subject: | |||
actually, don't need to use return at all, i was being stupid...
|
Author: | Andy [ Fri Jun 20, 2003 9:39 am ] |
Post subject: | |
what's with the exit when flag= true? that's completely useless since that statement only get ran when the music finishes and replays itself |
Author: | Mazer [ Fri Jun 20, 2003 10:06 am ] |
Post subject: | |
that's for when you music.playfilestop right before setting flag to true |
Author: | AsianSensation [ Mon Jun 23, 2003 9:58 pm ] |
Post subject: | |
Music.PlayFile only stops all currently playing music, it doesnt prevent future playing of music. Having the exit when flag will ensure that the music doesn't start playing again. |
Author: | Andy [ Tue Jun 24, 2003 10:35 am ] |
Post subject: | |
ooo ic, kk but that stops all the music from playing, is it possible to stop only one? without using Time.Elapse to check how long the other music have been playing then stop all the music then play the rest from where u left off? |