1 次元の Array インスタンスの指定したインデックス位置に、コレクション値をコピーします。
Public Sub CopyTo( _
ByVal array() As CompilerError, _ ByVal index As Integer _)
[C#]
public void CopyTo(CompilerError[] array,intindex);
[C++]
public: void CopyTo(CompilerError* array[],intindex);
[JScript]
public function CopyTo(
array : CompilerError[],index : int);
パラメータ
- array
CompilerErrorCollection の値のコピー先である 1 次元の Array 。 - index
コピー先の配列内のコピー開始位置を示すインデックス。
例外
例外の種類 | 条件 |
---|---|
ArgumentException | array パラメータに指定されている配列が多次元です。
または CompilerErrorCollection 内の要素の数が、array パラメータで指定されている配列内の、 arrayIndex パラメータで指定されているインデックス値から、array パラメータで指定されている配列の末尾までで使用できる数を超えています。 |
ArgumentNullException | array パラメータが null 参照 (Visual Basic では Nothing) です。 |
ArgumentOutOfRangeException | arrayIndex パラメータの値が、array パラメータで指定されている配列の下限値より小さくなっています。 |
使用例
' Copies the contents of the collection, beginning at index 0,
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)
[C#]
// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo( errors, 0 );
[C++]
// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection->CopyTo(errors, 0);
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
CompilerErrorCollection クラス | CompilerErrorCollection メンバ | System.CodeDom.Compiler 名前空間 | Array