language-extensions/R/test/src/Utilities.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::GetMaxLength
//
// Description:
//  Gets max length from given arrayOfLengths with size = rowsNumber.
//
:GetMaxLength
Description:
Gets max length from given arrayOfLengths with size = rowsNumber.
: GetMaxLength Description : Gets max length from given arrayOfLengths with size = rowsNumber .
SQLINTEGER Utilities::GetMaxLength(
	SQLINTEGER *arrayOfLengths,
	SQLULEN    rowsNumber)
{
	SQLINTEGER maxLen = 0;
	for (SQLULEN index = 0; index < rowsNumber; ++index)
	{
		if (arrayOfLengths[index] != SQL_NULL_DATA && maxLen < arrayOfLengths[index])
		{
			maxLen = arrayOfLengths[index];
		}
	}
	return maxLen;
}
SQLINTEGER Utilities :: GetMaxLength ( SQLINTEGER * arrayOfLengths , SQLULEN rowsNumber ) { SQLINTEGER maxLen = 0 ; for ( SQLULEN index = 0 ; index < rowsNumber ; ++ index ) { if ( arrayOfLengths [ index ] != SQL_NULL_DATA && maxLen < arrayOfLengths [ index ] ) { maxLen = arrayOfLengths [ index ] ; } } return maxLen ; }
Name: Utilities::GetMaxLength
Description:
Gets max length from given arrayOfLengths with size = rowsNumber.
Name : Utilities :: GetMaxLength Description : Gets max length from given arrayOfLengths with size = rowsNumber .