return() from within a while()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

return() from within a while()

Jeff Pyle
Hello,

Here's an easy one for you smart programming type people.

If a return(-1) is executed from within a while() loop, will it still return
to the previous route block, or will it only exit the while() and continue
processing in the current route block?


Thanks,
Jeff


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: return() from within a while()

Bogdan-Andrei Iancu
Hi Jeff,

it is like in C - a return will exit the current route(), doesn't matter
where you are (in a while, an if, a case, etc)

if you want to terminate the while, use "break" - it will jump after the
while().

Regards,
Bogdan

Jeff Pyle wrote:

> Hello,
>
> Here's an easy one for you smart programming type people.
>
> If a return(-1) is executed from within a while() loop, will it still return
> to the previous route block, or will it only exit the while() and continue
> processing in the current route block?
>
>
> Thanks,
> Jeff
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users