What are the best ways of returning multiple results from a subroutine ?
I've been using
... return [a, b, c] }
which is inelegant.
I'm used to Pascal's
procedure X(const A, B : integer; var C, D : byte) ;
where A, B are inputs only, and C, D are in/out.
The needed parameters tend to be numbers, and don't need to be objects.
... return {aa:a, bb:b, cc:c} } // seems OK
but with that the parameter names aa, bb, cc are not visible in the
calling statement, which is a defect.
I'm specifically trying to extend, neaten, & improve <URL:http://www.mer
lyn.demon.co.uk/js-date5#DDTA>.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Comment