The called method can omit the return value or the output values; LuaCOM them will return nil for each omitted value.
To illustrate these concepts, here follows a sample of these situations. First, we show an excerpt of an ODL file describing a method of a COM object:
HRESULT TestShort( [in] short p1, // an "in" parameter [out] short* p2, // an "out" parameter [in,out] short* p3, // an "in-out" parameter [out,retval] short* retval); // the return value
Now follows a sample of what happens when calling the method:
-- assume that "com" is a LuaCOM object -- Here we set p1 = 1, p3 = 2 and leave p2 uninitialized -- When the method returns, r1 = retval and r2 = p2 and r3 = p3 r1, r2, r3 = com:TestShort(1,2) -- WRONG! The are only two in/in-out parameters! Out parameters -- are ignored in the lua2com parameter translation r1, r2, r3 = com:TestShort(1,2,3) -- WRONG! -- Here p1 = 1, p2 is uninitialized and p3 is omitted. r1, r2, r3 = com:TestShort(1) -- Here we ignore the output value p3 r1,r2 = com:TestShort(1) -- Here we ignore all output values (including the return value) com:TestShort(1,2)