In vbscript x = y can be interpreted two ways. The first is as an assignment statement, where the value of y is assigned to x. The second interpretation is as an expression that tests if x and y have the same value. We use Eval method if x=y result is True; if they are not, the result is False.
And CBool method test, if expression x=y evaluates to a nonzero value, returns True; otherwise, it returns False.
And CBool method test, if expression x=y evaluates to a nonzero value, returns True; otherwise, it returns False.
Code:
Dim A, B, Check , c, D
A = 10: B = 5: c=5 : D=10 ' Initialize variables.
If Eval("A = B") Then
MsgBox "Congratulations! A is equal to B"
Elseif Eval("C=B") then
Msgbox "Congratulation! B and C are equal"
End If
'Cbool example
Check = CBool(A = B) ' Check contains False.
msgbox Check
A = 10 ' Define variable.
Check = CBool(A) ' Check contains False.
msgbox check
check = CBool(C=B) ' Check contains True.
msgbox check