Win32-OLE-0.1502 > Win32::OLE::Enum
Win32-OLE-0.1502
Other versions:
libwin32-0.26

名前

Win32::OLE::Enum - OLE Automation Collection Objects

Win32::OLE::Enum - OLE オートメーションコレクションオブジェクト

概要

    my $Sheets = $Excel->Workbooks(1)->Worksheets;
    my $Enum = Win32::OLE::Enum->new($Sheets);
    my @Sheets = $Enum->All;

    while (defined(my $Sheet = $Enum->Next)) { ... }

説明

This module provides an interface to OLE collection objects from Perl. It defines an enumerator object closely mirroring the functionality of the IEnumVARIANT interface.

このモジュールは Perl から OLE コレクションオブジェクトへのインタフェースを 提供します。 これは IEnumVARIANT インターフェースの機能をほとんどそのままのような列挙する オブジェクトを定義します。

Please note that the Reset() method is not available in all implementations of OLE collections (like Excel 7). In that case the Enum object is good only for a single walk through of the collection.

Reset() メソッドが OLE コレクションのすべての実装で利用できるわけではない (Excel7 のように)ことに注意してください。 その場合、Enum オブジェクトはコレクションを一度だけ通してみていくためだけに 有効です。

関数/メソッド

Win32::OLE::Enum->new($object)

Creates an enumerator for $object, which must be a valid OLE collection object. Note that correctly implemented collection objects must support the Count and Item methods, so creating an enumerator is not always necessary.

$object のための Enum オブジェクトを作成します。 $object は正しい OLE コレクションオブジェクトでなければなりません。 正しく実装されたコレクションオブジェクトは CountItem メソッドを サポートしていなければならないことに注意してください; そのため Enum オブジェクトは常には必要ありません。

$Enum->All()

Returns a list of all objects in the collection. You have to call $Enum->Reset() before the enumerator can be used again. The previous position in the collection is lost.

そのコレクションのなかのすべてのオブジェクトのリストを返します。 列挙するオブジェクトをもう一度、使う前に $Enum->Reset() を 呼ばなければなりません。 コレクション内の以前の位置は失われます。

This method can also be called as a class method:

このメソッドはクラスメソッドとしても呼び出すことができます:

        my @list = Win32::OLE::Enum->All($Collection);
$Enum->Clone()

Returns a clone of the enumerator maintaining the current position within the collection (if possible). Note that the Clone method is often not implemented. Use $Enum->Clone() in an eval block to avoid dying if you are not sure that Clone is supported.

(もし可能であれば)コレクションでの現在の位置を保持する Enum オブジェクトの クローンを返します。 Clone メソッドはしばしば実装されていないことに注意してください。 Clone がサポートされているかどうかわからなければ、die するのを避けるため eval ブロックで $Enum->Clone() を使ってください。

$Enum->Next( [$count] )

Returns the next element of the collection. In a list context the optional $count argument specifies the number of objects to be returned. In a scalar context only the last of at most $count retrieved objects is returned. The default for $count is 1.

コレクションの次の要素を返します。 リストコンテキストではオプションの $count 引数は返されるオブジェクトの数を 指定します。 スカラコンテキストでは $count の取り出されたオブジェクトの最後のものが 返されます。 $count のデフォルトは 1 です。

$Enum->Reset()

Resets the enumeration sequence to the beginning. There is no guarantee that the exact same set of objects will be enumerated again (e.g. when enumerating files in a directory). The methods return value indicates the success of the operation. (Note that the Reset() method seems to be unimplemented in some applications like Excel 7. Use it in an eval block to avoid dying.)

列挙の順番を最初に戻します。 全く同じオブジェクトの集合が再び列挙されるかどうかは保証されません(例えば ディレクトリに列挙されているファイルのとき)。 メソッドは処理が正常であることを示す値を返します(Reset() メソッドは Excel 7 のようにアプリケーションによっては実装されていないようであることに 注意してください。 die ことを避けるために、evalブロックを使ってください。)

$Enum->Skip( [$count] )

Skip the next $count elements of the enumeration. The default for $count is 1. The functions returns TRUE if at least $count elements could be skipped. It returns FALSE if not enough elements were left.

列挙の次の $count 分の要素を飛ばします。 $count のデフォルトは 1 です。 もし少なくとも $count 分の要素が飛ばすことができれば関数は TRUE を返します。 十分な数の要素が残っていなければ FALSE を返します。

AUTHORS/COPYRIGHT

This module is part of the Win32::OLE distribution.

このモジュールは Win32::OLE ディストリビューションの一部です。