Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AND operator issue
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
I have the code:

Code:
If blFlagA1=True AND blFlagA2=True AND blFlagA3=True AND blFlagA4=True Then

even though all four objects indacte True in my Variables list durring debugging, the If statement does not execute.

Does anyone have an idea on why?

thx guys

Lorena
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
it might be that the values in the variable is String. Here u r comparing with a boolean value.

try the below code

Code:
if blFlag="True" AND blFlagA2="True" AND blFlagA3="True" Then

I hope this would work.

Regards,
Ankesh
It might be that the values in the variables are string values and u r comparing for the boolean value.

Try the below code...
Code:
If blFlagA1="True" AND blFlagA2="True" AND blFlagA3="True" AND blFlagA4="True" Then


i hope this would work.

Regards,
Ankesh
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Ankesh,

Your the best. That was it. I guess I was mind numb last week as it never entered my mind to use double quotes. I just figurerd it was the variable within the OR. I guess I could have used 1 imnstead. But using double quotes worked as I wanted.

Thx ;-)
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi Lorena...good to know it is working fine as expected for you..

in such cases, do NOT check if it is true. just give the stmt as given below to avoid such syntax/run time error...

If blFlagA1 AND blFlagA2 AND blFlagA3 AND blFlagA4 Then
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
vIns,

Thx! I tried this earlier but QTP just didn't like the coding structure for whatever reason. I hope to try this again once I get my co0mplete code successfully coded and running.

thx for reading and giving a pointer. ;-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dividing a term into years and months using mod operator in VBScript Brian.Osborne 1 2,922 02-18-2011, 10:54 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)