Sign in to follow this  
Followers 0
wimhek

About Logic

5 posts in this topic

In my script I want to code

If condition a and condition b do something

Is this possible in Autoit ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If $A and $B Then

Else

EndIf

Edit: Give more detail about your condition.

Edited by Generator

Share this post


Link to post
Share on other sites

If $Thing1 = $Right And $Thing2 = $Right2 Then
     ;Stuff you want to do if both are right
EndIf

That what you mean?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

In my script I want to code

If condition a and condition b do something

Is this possible in Autoit ?

The above methods are valid methods, or another way you could do it, is using something called nested loops.

If condition a Then
     If condition b Then
          do something
     EndIf
EndIf

This way is however probably what most people would consider the stupid way to do it. It's much easier to use the previously posted methods, that use the 'And' statement, which checks to see if both conditions are true. Another statement that is common is the 'Or' statement which checks to see if one or the other conditions is true. For instance:

If condition a And condition b Then
     do something
EndIf

hope this helps bro.

Edited by spierce7

Share this post


Link to post
Share on other sites

Yes thanx it works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0