System.Generics.Collections.TList.Insert

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

procedure Insert(Index: Integer; const Value: T); inline;

C++

void __fastcall Insert(int Index, const T Value);

プロパティ

種類 可視性 ソース ユニット
procedure
function
public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TList


説明

リストにエントリを挿入します。

Insert は、要素 Value をリスト内のインデックス Index の位置に挿入します。リストの Count が既に Capacity と等しい場合には、Capacity が増やされます。

このリストで Index が有効でない場合には、EArgumentOutOfRangeException 例外が発生します。

これは O(n) 操作であり、ここでの n はリスト内の項目の数です。

OnNotify イベントが発生し、リストに項目が挿入されたことを示します。

関連項目

コード例