Author |
Message |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sat May 24, 2003 9:04 am Post subject: How to stop a process? |
|
|
ok I've got:
code: | process gtch
getch (direction)
end gtch |
running via:
I'd like to know how to halt this process. Thanks. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sat May 24, 2003 12:55 pm Post subject: (No subject) |
|
|
insted of using a proces i whould use:
code: |
if hasch then
getch (direction)
end if
|
and put that in your main loop, but if you think you real have to use a proces i whould put some kind of if and a golabe varible that will will be set to ture or false. if it is flase it will no longer get the ch. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sat May 24, 2003 1:00 pm Post subject: (No subject) |
|
|
if you use Input.KeyDown you dont event have to check if anything is pressed or not... all variables are just set to false ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sat May 24, 2003 1:26 pm Post subject: (No subject) |
|
|
I tried doing the boolean thing dan, it still checks the process, I'm sure there has to be a function or a method to actually stop check it. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sat May 24, 2003 4:39 pm Post subject: (No subject) |
|
|
wait, what the heck are you halting there anyway? your process isn't even a loop.. it just sits there and waits for input |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sat May 24, 2003 5:22 pm Post subject: (No subject) |
|
|
well that's the sample code...
realistically it's:
code: | loop
fork gtch
end loop |
|
|
|
|
|
![](images/spacer.gif) |
JSBN
![](http://genesis.thruhere.net/site/templates/fisubsilversh/images/news/avatarS.gif)
|
Posted: Sat May 24, 2003 5:52 pm Post subject: (No subject) |
|
|
use boolean data
code: |
procedure forkyMcFork
if stop = false then
run fork
end if
end forkyMcFork
loop
forkyMcFork
if a = b then
stop = true
end if
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sat May 24, 2003 9:38 pm Post subject: (No subject) |
|
|
JSBN, tried it before I posted. still gets hung on getch in the process... |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
|