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

Username:   Password: 
 RegisterRegister   
 End fork
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jolly50




PostPosted: Fri Nov 23, 2007 4:50 pm   Post subject: 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:

code:


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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Nov 23, 2007 7:30 pm   Post subject: 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).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
jolly50




PostPosted: Fri Nov 23, 2007 9:09 pm   Post subject: RE:End fork

Umm....
could you elaborate more on this?
Nick




PostPosted: Fri Nov 23, 2007 10:02 pm   Post subject: RE:End fork

so a process will be called like this
code:
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




PostPosted: Fri Nov 23, 2007 10:19 pm   Post subject: 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.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: