Find Data Member Function

Finds a value in the <ColorArray> and returns the index or -1 if the value is not found.

Prototype

int32 Find( Color p_oColor, int32 p_nStartIndex )

Parameters

Parameter Type Parameter Name Documentation
<Color>p_oColorA pointer to the <Color> object whose index you wish to find.
int32p_nStartIndexThe index in the array at which to start the search.

Examples

Copy Text To Clipboard

import library "type_color_array_util.ssl";

auto Color r = new Color( 255, 0, 0, 255 );
auto Color g = new Color( 0, 255, 0, 255 );
auto Color b = new Color( 0, 0, 255, 255 );

auto ColorArray data;
data.Add( r );
data.Add( g );
data.Add( b );

auto Color f = new Color( 0, 255, 0, 255 );

Console.Out( data.Find( f, 0 ) );

Results

2 // Found matching item at index 2 in the array.