[aplusdev] How to stop function execution?

Vladimir N. Kutinsky kutinskyv at obninsk.com
Mon Jan 28 23:12:04 EST 2002


Hello,

Is there a way to stop function execution at some point. For example:
        foo{x}:{
        if(x>0) {result<-x;exit the function and return the result};
        if(x<0) {result<-(-x);exit the function and return the result};
        do something else with x equal to zero..
        }
Yes, the example above can be solved with "if..else", but what if I have
dozens of "if"s?
In case with "case" control statement:
        case(x>0){
            0;'less or equal';
            1;'greater';
            }
,it is not clear how to check if x=0. To use another case(if)?

Thank you,

Vladimir




More information about the apluslist mailing list