
-----------------------------------
jolly50
Fri Nov 23, 2007 4:50 pm

End fork
-----------------------------------
Hey,

I know that processes are bad, but i need help to complete my game

how do i end a fork?

i tried having a code like:



procedure wingame
    if coins=2000 then
        end fork PlayBackgroundMusic
        fork wingamesound
    end if
end wingame



and i get a whole bunch of errors saying that the end fork is supposed to be end if


if any one can help that would be greatly appreciated

-----------------------------------
Tony
Fri Nov 23, 2007 7:30 pm

RE:End fork
-----------------------------------
a process is a void function with an additional "benefit" of being able to fork. You end it the same way you end any other function, that is -- get to the end of it (perhaps with an arbitrary return).

-----------------------------------
jolly50
Fri Nov 23, 2007 9:09 pm

RE:End fork
-----------------------------------
Umm....
could you elaborate more on this?

-----------------------------------
Nick
Fri Nov 23, 2007 10:02 pm

RE:End fork
-----------------------------------
so a process will be called like this
process playMusic(musicPath:string)
Music.PlayFile(musicPath)
end playMusic
and ur calling it with an end before you even fork it?

another note you do not need to end the process as it will automatically end as it finishes

-----------------------------------
Zampano
Fri Nov 23, 2007 10:19 pm

Re: End fork
-----------------------------------
Since to use that process you must be (or probably are) using a loop inside it at the same time, just make an exit when to leave the loop and finish the process.
