diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-0AF14EE0-D4FD-53EA-B7E5-10724E3FA0DF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-0AF14EE0-D4FD-53EA-B7E5-10724E3FA0DF.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,45 @@ + + + + + +How +to resize an arrayFor fixed flat and fixed segmented arrays, it is possible to resize +the array. If the array is shortened, then the trailing elements are deleted. +If the array is extended, then new blank elements are created using the default +constructor. +

In a CArrayFixFlat<class T> or a CArrayFixSeg<class T> array, +the number of elements in an array can be changed, either decreased or increased, +using the ResizeL() function.

+

In the following code fragment, ResizeL() changes the +size of an array so that it contains only one element. If the array originally +had more than one element, then this call to ResizeL() deletes +all elements from position one onwards, leaving only the element at position +zero.

+CArrayFixFlat<TElement>* fixflat; +fixflat = new (ELeave) CArrayFixFlat<TElement>(3); +... +fixflat->ResizeL(1); +

Call ResizeL() again to change the size of the array to +contain a greater number of elements, in this case three. If the array originally +had only one element (for example), this call to ResizeL() constructs +two new elements at positions one and two. In this example, the new elements +inserted at positions one and two are TElement type objects, +constructed using the TElement default constructor. +It is therefore essential that a default constructor exists before using this +function.

+fixflat->ResizeL(3); +

There is an overloaded variant of ResizeL() which takes +a reference to a TElement object. A bit-wise copy of this +referenced object supplies the new elements. In the following code fragment +the two extra elements are bit-wise copies of the theElement object.

+_LIT(KTextXXX,"XXX"); +theElement.iData = KTextXXX; +fixflat->ResizeL(5,theElement); +
\ No newline at end of file