08-03-2010, 01:26 PM
..............................................................................................
I did one mistake in the script. I didn't use the Exit Function statement when the row count is 0 or 1 as that point of time we don't need to compare.
I did one mistake in the script. I didn't use the Exit Function statement when the row count is 0 or 1 as that point of time we don't need to compare.
Code:
intRowCnt = Object.Table().RowCount
Public Function Comapre_Table_Element(intRowCnt)
If (intRowCnt = 0 Or intRowCnt = 1) Then
blnStatus = False
Exit Function
End If
For intItemCntx = 0 To intRowCnt - 1
strGetVal1 = Object.Table().GetCellData(intItemCntx, "Level")
For intItemCnty = intItemCntx + 1 To intRowCnt - 1
strGetVal2 = Object.Table().GetCellData(intItemCnty, "Level")
If (StrComp(strGetVal1, strGetVal2, VbTextCompare) = 0) Then
blnStatus = False
Exit For
Else
blnStatus = True
End If
Next
If (blnStatus = False) Then
Exit For
End If
Next
Comapre_Table_Element = blnStatus
End Function