1. Question for Robert Craig
- Posted by "BABOR, JIRI" <J.Babor at GNS.CRI.NZ> Jul 25, 1997
- 623 views
Rob, I have been using *return* clause not only in functions, but also in proc edures. Mainly in recursive routines, and, occasionally, as a shortcut from complicated elsif structures. It seems to work, but is it legitimate, or more importantly, is it g oing to be ok in future releases of Euphoria? Jiri
2. Re: Question for Robert Craig
- Posted by Robert Craig <rds at MSN.COM> Jul 25, 1997
- 590 views
- Last edited Jul 26, 1997
Jiri Babor writes: > Rob, I have been using *return* clause not only in functions, but also in > procedures. > Mainly in recursive routines, and, occasionally, as a shortcut from > complicated elsif > structures. It seems to work, but is it legitimate, or more importantly, > is it going to > be ok in future releases of Euphoria? Jiri Yes, executing a return statement in a procedure is totally legitimate. It has been there since day 1, and will always be there. When you return from a *function* you must supply a value to return to the caller e.g. return 9 * length(x) but when you return from a *procedure* you can just say: return Control is passed immediately back to the caller of the procedure. No value is returned. Only *functions* return values. In practice it seems like most procedures terminate by simply reaching "end procedure", but you can end earlier by executing *return*. Regards, Rob Craig Rapid Deployment Software