1. ## Comparison

hi can anybody tell me why this comparison is always true for below code,

the code is

Max=Datatable("Max",dtGlobalSheet)
Call Vaidate(Max)

Function Validate(Max)
Min=Browser("a").Page("b").Frame("c").WebEdit("min ").GetROProperty("value")
Max1=Max+1
If Min&lt;&gt;Max1 Then
MsgBox "Error"
Datatable("Result",dtGlobalSheet)="Fail"
End If
End Function

' Min&lt;&gt;Max1 condition is getting always true even if the values are not equal for example
Max1=200
Min=12 is getting true.

What is the problem, acutly am facing lot of troubles in comparison.

2. ## Re: Comparison

If I have understood your question properly; your code shows that Min is not equal to Max1. The condition has to be true.

3. ## Re: Comparison

Am extreamly very sorry that was my typing mistake,

its getting true even if

Min=700
and Max1=700

what is the mistake?

4. ## Re: Comparison

Try to use Trim function on the variables.
ex:
If Trim(min)&lt;&gt;Trim(max)
.....
.....
EndIf

5. ## Re: Comparison

Try this-
If not Min=Max1 Then
MsgBox "Error"
Datatable("Result",dtGlobalSheet)="Fail"
End If

Is it string or numeric value.

6. ## Re: Comparison

It could be because the GetROProperty would be returning the value as string.

Use this

If CInt(Min) &lt;&gt; CInt(Max1) Then
MsgBox "Error"
Datatable("Result",dtGlobalSheet)="Fail"
End If

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:54 PM.