Re: How is this conditional able to execute?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Brett,

Set a breakpoint on that If line. When it's hit, pull up the Immediate Window (Ctl + Alt + I) and enter the following:

?(returndata.ToString <> "") And (returndata.ToString <> ClientForm.ReturnData)

Include the question mark at the beginning of the line.

If that evaluates to False, you know the conditional isn't executing.

If it evaluates to True, test each individual expression. The only way that And will work is if both expressions evaluate to true. There must be something else going on.

Let us know how you go.

Regards,
-Adam.

Brett wrote:
The following conditional executes given the values listed. I've listed the values below for each of these variables. How is it that the conditional still executes:

If (returndata.ToString <> "") And (returndata.ToString <> ClientForm.ReturnData) Then

returndata.ToString = ""
ClientForm.ReturnData = Nothing

The first test fails and the second passes. The AND should then fail correct?

Thanks,
Brett



.