VBScript ReturnCaseComparisonValue

'********************************************************************

'*

'* Function ReturnCaseComparisonValue

'*

'*   Author: NetworkAdminKB.com

'*  Created: 2008-08-05

'* Modified: 2008-08-05

'*

'* Purpose: Returns the proper VB String Comparison Constant based on

'*            the provided boolean in blnCase

'*

'* Input:   blnCase   A boolean indicating case sensitive comparisons.

'*                      True  = Case Sensitive comparison

'*                      False = Case Insensitive comparison (Default)

'*

'* Output:  Returns the proper VB String Comparison Constant based on

'*            the provided boolean in blnCase.

'*            vbBinaryCompare 0 Perform a binary (case sensitive) comparison.

'*            vbTextCompare   1 Perform a textual (case insensitive) comparison.

'*          Returns vbTextCompare if blnCase is anything other than True

'*             (ie Empty, Null, a String, etc).

'*

'********************************************************************

Function ReturnCaseComparisonValue(ByVal blnCase)

  'Version 1.0 2008-05-18

 

  Select Case blnCase

    Case True

      'vbBinaryCompare provides case sensitive comparison

      ReturnCaseComparisonValue = vbBinaryCompare

    Case False

      'vbTextCompare provides case insensitive comparison

      ReturnCaseComparisonValue = vbTextCompare

    Case Else

      'Return Defuault Setting.

      ReturnCaseComparisonValue = vbTextCompare

  End Select 'blnCase

End Function 'ReturnCaseComparisonValue

Article ID: 417, Created On: 9/25/2011, Modified: 9/25/2011