I may be missing something, but cant you just use return?
As in
Code:
function firstone()
{
    while(1)
    {
       if(xxx==0)
       {
           nextfunction();
           return;
       }
       wait(1);
    }
}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial