DTwainRange::GetValuePosition

Top  Previous  Next

Syntax

DTwainDoubleArray:

long GetValuePosition( double Value ) const;

 

DTwainLongRange:

long GetValuePosition( long Value ) const;

 

Parameters

Value

Value to search for

 

Return Value

Returns the position of the value Value within the range  If unsuccessful, -1 is returned.

 

Comments

DTwainRange::GetValuePosition gets the position of a value within an expanded range.  Range expansion is the act of taking a range and generating all of the numbers that the range defines.  The minimum, maximum, and step sizes determine the expanded numbers. For example if the DTwainRange has the following characteristics:

 

minimum = -10

Maximum Value = 10

Step size = 2

 

The expanded range will consist of the following values

-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10

 

DTwainRange::GetValuePosition(-6) would be equal to 2, since -6 is the third number in the range, and that position numbers are zero based ( 3 - 1 = 2 )