lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


With Lua, you can return multiple values at once, and those can even be
tables. I would do this as (sort-of Lua function prototype):

	ret, a2, a3= LuaM( a1, term, start )

This, of course, assuming that 'a2' and 'a3' are "output only". If you also
want to feed them in, you'll need to add more param tables like 'a1'. 

To do this in practise, you can use e.g. Glua-X library from the wiki. It
allows returning Lua tables from C code. Have a look:
http://lua-users.org/wiki/LuaAddons

- Asko Kauppi
  Flextronics Finland

P.S. What's in the 'Array' anyways?


> -----Original Message-----
> From:	Jim Jones [SMTP:jjones@aantix.com]
> Sent:	Thursday, August 22, 2002 6:17 PM
> To:	Multiple recipients of list
> Subject:	Exposing C function via Lua
> 
> I have the following C function that I would like to make available to
> Lua.
> 
> 
>             short M(Array *a1, Array *a2, Array *a3,short term, short
> start)
> 
> 
> The results are returned via a2 and a3.  What would be the best way to
> expose this function via Lua?
> 
> Jim
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.