Hi all,
I would like to iterate through, and print out methods and properties
of 'editor' object, and the content of 'props' (a pseudo-array, as
http://lua-users.org/wiki/UsingLuaWithScite calls it) from Lua. I am
trying the following function:
function PrintProps()
print(editor)
print(props)
print(tostring(editor))
print(tostring(props))
print(getmetatable(editor))
print(getmetatable(props))
-- iterate over array:
-- bad argument #1 to 'pairs' (table expected, got userdata):
--~ for i,v in pairs(editor) do print(i,v) end
--~ for i,v in pairs(props) do print(i,v) end
-- ipairs don't work below?
print("---1---")
for i,v in pairs(getmetatable(editor)) do print(i,v) end
print("---2---")
for i,v in pairs(getmetatable(props)) do print(i,v) end
end
.... and I'm getting the following output:
userdata: 0x8469de4
userdata: 0x860c1cc
userdata: 0x8469de4
userdata: 0x860c1cc
table: 0x85cecf0
table: 0x85cebf0
---1---
__newindex function: 0x85bd8c0
textrange function: 0x85ceeb8
findtext function: 0x85bd8d8
insert function: 0x85ceef0
append function: 0x85cee58
remove function: 0x85cee40
__index function: 0x85bd888
match function: 0x85ceff0
---2---
__index function: 0x85cec18
__newindex function: 0x85cec50
So, some functions do get shown for 'editor', but I cannot get to,
say, props['FileName'] and such... Is that possible to do at all - and
if so, would anyone have a reference to a snippet?
Thanks in advance for any responses,
Cheers!