Insert Data Member Function

Inserts a <Color> value into the array. Does not deallocate or destroy the <Color> object. May incur re-allocation costs depending on the size of any allocated reserve.

Prototype

int32 Insert( int32 p_nIndex, Color p_oColor )

Parameters

Parameter Type Parameter Name Documentation
int32p_nIndexThe index at which to insert the <Color> object.
<Color>p_oColorThe <Color> object to insert into the <ColorArray>.

Examples

Copy Text To Clipboard

import library "app_service_console_util.ssl";
import library "type_color_array_util.ssl";

auto Color r = new Color( 1, 1, 1, 255 );
auto Color g = new Color( 2, 2, 2, 255 );
auto Color b = new Color( 3, 3, 3, 255 );

auto ColorArray data;
data.Add( r );
data.Add( g );
data.Insert( 0, b );

LibColorArray.Out( data );

Results

COLORARRAY OUTPUT generated by TYPE_COLOR_ARRAY_UTIL.SSL
3,
3,
3,
255,
1,
1,
1,
255,
2,
2,
2,
255