DTWAIN_ArrayAddN

Top  Previous  Next

The DTWAIN_ArrayAddN function adds N copies of a value to the end of a DTWAIN_ARRAY.

 

DTWAIN_BOOL DTWAIN_ArrayAdd (

DTWAIN_ARRAY

Array,

LPVOID

pValue 

LONG

NumCopies );

 

Parameters

Array

DTWAIN_ARRAY that the value will be added to.

 

pValue

Address of the value to add.


NumCopies

Number of copies of Value to add to the array.


 

Return Values

TRUE if successful, FALSE otherwise.  If the function returns FALSE, call DTWAIN_GetLastError() to get extended information.

 

Comments

The DTWAIN_ArrayAddN function adds NumCopies of the value located at address pValue to the end of the DTWAIN_ARRAY Array.  The number of elements in the DTWAIN_ARRAY is increased by NumCopies.

 

The data type of the value located at the address pValue must match the data type that is stored in Array.  DTWAIN cannot determine the data type located at address pValue, therefore it is the responsibility of the programmer to provide the correct type.

 

An alternative to DTWAIN_ArrayAdd are the following specialized versions of DTWAIN_ArrayAddN that work for specific types of DTWAIN_ARRAY's:

 

DTWAIN_ArrayAddFloatN

DTWAIN_ArrayAddFloatStringN

DTWAIN_ArrayAddLongN

DTWAIN_ArrayAddLong64N

DTWAIN_ArrayAddANSIStringN

DTWAIN_ArrayAddWideStringN

DTWAIN_ArrayAddStringN

 

Note: For ease of use, when adding strings to a DTWAIN_ARRAY, it is recommended to use the DTWAIN_ArrayAddANSIString(), DTWAIN_ArrayAddWideString(), and DTWAIN_ArrayAddString() functions.


TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

See Also

Adding, Setting, and Inserting elements in a DTWAIN_ARRAY