lua-users home
lua-l archive

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


I have a library function that has a variable number of return values.  It uses a Lua interface function to format its arguments and pass back the return values from the library function.  The intent was to use the tail call behavior to move the library function's returned values back to the Lua script that calls the Lua interface function.
 
-- Get Attribute Single interface function for dn.gas library function
function gas( className, InstanceId, attrName, comment )
 return(dn.gas(  className, Node[className]["id"],
   InstanceId,
   attrName, Node[className][InstanceId][attrName]["id"],
   Node[className][InstanceId][attrName]["type"],
   comment )
  )
end

The difficulty I am having is in the return values.  By stepping through the library function it is known that two values are put on the stack to be returned, and the library function returns the value 2.  When the returned values from the interface function are displayed the first is correct but the second is a nil value.
 
Should this work or is there a better technique to use?
 
Thanks,
Al


Connect and share in new ways with Windows Live. Get it now!