RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSmallIntArray.PutItem Method

Replaces the value of an element in the array.

Pascal
procedure PutItem(index: Integer; value: SmallInt);
C++
__fastcall PutItem(int index, SmallInt value);

Call PutItem to change the value of an integer to the value Value. Unlike the Insert method, PutItem does not add a new item to the array, but replaces the value of an existing element. The Index parameter indicates which element to change, where 0 specifies the first element, 1 specifies the second element, and so on.

Note: Calling PutItem with Index set to the value of the Count property will add a new element to the end of the array. This is the only case where PutItem adds a new element instead of replacing an existing one.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!