[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Return a variable number of values from function
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 18 Nov 2001 23:22:37 -0200
> function foo ()
> return {6, "hello", {}, 32}
> end
>
> Result = foo()
> NumValues = getn(Result)
> FirstValue = Result[1]
> LastValue = Result[NumValues]
Returning a table is fine, but if you insist in returning a list of values
instead of a table, use "unpack", introduced in 4.1 (alpha).
--lhf