[Users] Re: [Devel] test return code in config file

Klaus Darilion klaus.mailinglists at pernau.at
Wed Jun 29 17:36:08 CEST 2005


Bogdan-Andrei Iancu wrote:
> 
>>
>> Is there a differnce between
>>   return(0);
>> and
>>   break;
>> ?
>>
> just to clarify a little bit - the return code convention is like this: 
> if a function returns 0, the entire script execution will be stopped. If 
> is a negative value -> false; if positive ->true.
> Now, return(0) returns with code 0 -> is the same as exit -> it will 
> terminated the script execution.
> on the other hand, break is used to terminate only the current route (is 
> similar to return(1) )

Are you sure?
AFAIK break; return 0
If return(0) also returns 0, then it is like break and only exits from 
the current route block.

If your statement is correct, it is possible to exit ser.cfg from any 
route block by return(0)? I didn't knew that.

regards,
klaus




More information about the sr-users mailing list