NextPrevUpTopContentsIndex

do-collection-items

Macro
Summary

Iterates over the items of an Automation Collection.

Package

com

Signature

do-collection-items ( item collection ) form *

Arguments

item

A symbol bound to each item in the collection in turn.

collection

A form which is evaluated to yield a COM i-dispatch interface pointer that implements the collection protocol.

form

A form to be evaluated.

Description

The do-collection-items macro executes each form in turn, with item bound to each item of the collection .

Note that for collections whose items are interface pointers, the form s must arrange for each pointer to be released when no longer needed. The collection should be a COM interface pointer for an i-dispatch interface that implements the Collection protocol. The items are converted to Lisp as specified in Data conversion when calling Automation methods.

Example

For example, to iterate over the Table objects from the Tables collection of a MyDocument interface pointer

(with-temp-interface (tables)
    (call-dispatch-get-property
       (doc my-document tables))
  (do-collection-items (table tables)
    (inspect-the-table table)
    (release table)))
See also

call-dispatch-method


LispWorks COM/Automation User Guide and Reference Manual - 17 Jul 2006

NextPrevUpTopContentsIndex