. on Windows XP.
I'm using the MS Office 2007 word template.
A:
I know this is a rather old question, but my Google-Fu was weak this morning, so I couldn't find the answer.
So, if you are stuck with this version of MS Word, and you need to set an existing MS Word 2003 document to include a component that is supposed to be in a different template, the answer is:
Go to the Document properties and open the Compatibility tab
Under Windows, you have a choice of Compatibility modes. Choose "Windows XP Mode"
Under "Compatibility Modes" in Word, choose "Windows XP Compatible"
And then you can click OK, save the document, and it should be fine.
Q:
Lua: htonl() gives me "bad argument #2 to 'htonl' (table expected, got nil)"
I'm trying to convert the value of the OpenAL texture's offset from OpenAL to host (native) byte format. The function htonl() works for integers, but fails when used on a table (probably because I'm missing an argument?). The following functions produce the same error: htonl(0); htonl(nil); htonl({}); htonl({0}); and even htonl({{"}}).
Here's my code:
// host-to-native byte format
native = new_bitfield(Tableau.buf, NumPts, "texture")
function htonl (t)
return ((n = native):htonl(t[1], t[2], t[3]))
end
As you've noticed, htonl is an integer function, so its first parameter (the first argument to call the function) must be an integer. The second parameter (the one that takes the table as an argument) is irrelevant, because it's the function. The third parameter, also irrelevant, is what the function returns.
If you want to take a table as an argument and return a table, you need to make that table an integer. The way to do that is to put the table contents in a new table:
local new_table = {};
for key, value in pairs(t) do
table.insert(new_table, value);
end
Related links:
Comments