I wonder that, why sometimes each() says that it is a get/set property, though it is actually a function.
but how to set property using such function?
it would always tells me that parameter is not correct.
demo:
word = sys.COM("Word.Application", true)
for k,v in each(word) do if v:sub(-8)=='property' then print(k,v) end end
for k,v in each(word) do
if v:sub(-8)=='property' then
vtype = type(word[k])
print(k,v , vtype )
if vtype == 'function' then break end end end
got:
...
MouseAvailable get property boolean
International get property function
► word.International
function
► word.International()
>>> bad argument #1 to 'International' (COM instance expected, got no value)
► word:International()
>>> COM error: unknown error
► word:International(0)
► word:International(21)
true
► word:International(0, 21)
>>> COM error: bad parameter count
https://www.luart.org/doc/sys/COM-iteration.html
"method": the field is a method that can be called.
"get property": the field is a property that can be get.
"set property": the field is a property that can be set.
Sub vbainword()
Debug.Print Application.International(wd24HourClock)
Debug.Print wd24HourClock
' got: True 21
End Sub
[Login to see the link]
Application.International property (Word)
Syntax
expression.International (Index)
Returns information about the current country/region and international settings. Read-only Variant.
the problem of microsoft is that, sometimes, a property is a function.
not really a problem. just that when you say it is "set property", check that if its type is a function.