DTWAIN_ArrayFindLong64
The DTWAIN_ArrayFindLong64 function searches for a LONG64 (64-bit integer) value in a DTWAIN_ARRAY.
LONG DTWAIN_ArrayFindLong (
Parameters Array DTWAIN_ARRAY to search.
Value LONG64 value to search for
Return Values If the function succeeds, the zero-based position of the element is returned. Otherwise -1 is returned if the element cannot be found, or another error has been encountered.
Comments DTWAIN_ArrayFindLong64 is a specialized version of DTWAIN_ArrayFind for LONG64 values.
The DTWAIN_ArrayFindLong64 function searches the DTWAIN_ARRAY Array, and returns the position of the first element that is equal to Value.
This function will only work for DTWAIN_ARRAY's that can store LONG64 values (i.e. the DTWAIN_ARRAY was created with the DTWAIN_ARRAYLONG64 style. See DTWAIN_ArrayCreate for more information).
Example: /* Find an element in a DTWAIN_ARRAY */ void Func( ) { DTWAIN_ARRAY Array; LONG64 i; LONG Position; LONG64 SearchVal;
/* Create a DTWAIN_ARRAY with 4 elements */ Array = DTWAIN_ArrayCreate(DTWAIN_ARRAYLONG64, 4);
/* Store the values 0, 2, 4, and 6 in the DTWAIN_ARRAY */ for ( i = 0; i < 4; i++ ) DTWAIN_ArraySetAtLong64( Array, i, i*2 )
/* Search for 2 */ Position = DTWAIN_ArrayFindLong64( Array, 2 );
/* Position should be a 1, since the '2' was stored at Array[1] */
/* Search for 6 */ Position = DTWAIN_ArrayFindLong64( Array, 6 );
/* Position should be a 3, since the '6' was stored at Array[3] */
/* Destroy the array */ DTWAIN_ArrayDestroy( Array ); }
TWAIN State Transitions None.
Prerequisite Function Call(s)
See Also |