Computer Science Canada

Process end

Author:  Reza [ Wed Jun 01, 2005 7:34 pm ]
Post subject:  Process end

hey guys,
i was wondering if you can end a process after you have forked it.
for example you have a process with an infinite loop and you've forked it.
how do u stop it later when u want? Rolling Eyes

Author:  jamonathin [ Wed Jun 01, 2005 7:40 pm ]
Post subject: 

Yeah, just use a variable to tell the loop when to end, like this program. Juss press any key to stop it.
code:
var a : int := 0
process thing
    loop
        drawfilloval (Rand.Int (0, maxx), Rand.Int (0, maxy), 10, 10, Rand.Int (1, maxcolor))
        exit when a = 1
    end loop
end thing
fork thing
loop
    if hasch then
        a := 1
        exit
    end if
end loop


: