Message-ID: <1173193670.1103.1406229473355.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1102_922464309.1406229473354" ------=_Part_1102_922464309.1406229473354 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The syntax for calling a method on an ActiveXObject is =
(mostly) the same as calling a method on any other Groovy object. The only =
caveat is that optional parameters may be omitted, or you can specify
In Groovy, which follows the JavaBean model, properties don't have index= es. There are lots of COM properties without indexes, and they work t= he same way. In the code example below, the voice.Status property returns an ActiveXObject, and the Ru= nningState property returns an integer flag.=20 =20
COM also supports parameterized (or 'indexed') properties. Indexed=
COM properties look like an array, list, or a map. Properties may be read =
from or written to, but they do not represent standalone objects (that's
not an array you are working with). In some cases, propertie=
s have more than one index. The following practical example sets the value =
of the first column in an Excel spreadsheet to a date value (alternate=
ly, a Java Date could have been used).
Yep, that's a property!
Methods and a property getters (both non-indexed and indexed) are pretty=
much the same thing, and in most cases, they are interchangeable. So=
the following two lines of code do the same thing:
Indexed properties don't work if all the parameters are optional.&n= bsp; This doesn't normally happen in the real world (why would you do = that?), but it is possible. To support this unlikely scenario, there = is an alternate syntax for accessing properties as methods:=20
To set a property value, prefix the property name with _se=
t or _put. The last argument passed to the =
method is the value.
The method syntax is actually a little faster than the bracketed propert= y syntax, but we recommend that you use the syntax that makes your intentio= ns most evident.